Could you post the results of:
summary(unmarked.dat)
and maybe:
show(unmarked.dat)
Also, it sounds like you coded the dummy variables by hand, which is
unnecessary. It's much easier and less error prone to import the data
with a single column for habitat type. R will treat this as a factor
with a level for each habitat type and you could use:
occu(~habitat.type ~habitat.type, unmarked.dat)
Hope this helps,
Richard
Quoting Kristin Broms <bro...@gmail.com>:
--
Richard Chandler
UMass Amherst
Natural Resources Conservation
nrc.umass.edu/index.php/people/graduate-students/chandler-richard/
y <- matrix(c(1,1,NA,0), 2)
x <- matrix(c(-1,3,NA,2), 2)
umf <- unmarkedFrameOccu(y=y, obsCovs=list(x=x))
summary(occu(~1~x, umf))
I know that this was not around previously, so it might be related to
a new R version. What version are you using? I'm on 2.11.1. I'll try
to fix this soon. Thanks for the report.
y <- matrix(c(1,1,NA,0), 2)
x <- matrix(c(-1,3,NA,2), 2)
umf <- unmarkedFrameOccu(y=y, obsCovs=list(x=x))
summary(occu(~x~1, umf))
which does not incorrectly remove sites. Could you send me the file
created by:
umf <- as(unmarked.dat, "data.frame")
dump("umf", "umfDump.R")
Thanks,
One thing to remember when formatting observation-level covariates is
that they need to be in site-major order. This is only an issue if
supplying a data.frame to obsCovs. I find it easier to use a list of
matrices instead. Here is an example to help clarify this.
y <- matrix(c(1,1,NA,0), 2)
x <- matrix(c(-1,3,NA,2), 2)
(umf1 <- unmarkedFrameOccu(y=y, obsCovs=list(x=x)))
(umf2 <- unmarkedFrameOccu(y=y, obsCovs=data.frame(x=as.vector(t(x)))))
all.equal(umf1, umf2)
Either of the above methods is correct. However, this is incorrect
because x is not transformed before converting to a vector:
unmarkedFrameOccu(y=y, obsCovs=data.frame(x=as.vector(x)))
Richard