I get the same error when trying to run an occupancy model. I am trying to practice, and have downloaded the data from MacKenzie et al 2002. I am trying to run the occupancy models for the american toad. There are many "-" or NA values in the dataset. When I run the summary of my unmarkedFrameOccu where "data" is the dataframe of occupancy data and habitat is a site covariate vector.
28 sites
Maximum number of observations per site: 82
Mean number of observations per site: 82
Sites with at least one detection: 10
Tabulation of y observations:
- 0 1 <NA>
2044 221 31 0
Site-level covariates:
X1
Min. :0.0000
1st Qu.:0.0000
Median :0.0000
Mean :0.2857
3rd Qu.:1.0000
Max. :1.0000
When I delete the NAs, as was suggested for Hugh's problem, I get the error when I try to create the unmarkedFrameOccu:
Error in validObject(.Object) :
invalid class “unmarkedFrame” object: siteCovData does not have same size number of sites as y.
What is the proper way of handling NAs?
Thanks,
Brian