# Fake data
S <- 3 # number of species
M <- 4 # number of sites
J <- 3 # number of visits
y <- list(matrix(rbinom(M*J,1,0.5),M,J), # species 1
matrix(rbinom(M*J,1,0.5),M,J), # species 2
matrix(rbinom(M*J,1,0.2),M,J)) # species 3
site.covs <- data.frame(x1=1:4, x2=factor(c('A','B','A','B')))
site.covs
umf <- unmarkedFrameOccuMulti(y=y, siteCovs=site.covs,
obsCovs=NULL) # organize data
umf # look at data
summary(umf) # summarize
plot(umf) # visualize
#fm <- occu(~1 ~1, umf) # fit a model
Run the code above in your browser using DataLab