I am trying to fit a single season occupancy model.
I am running into errors with my obsCovs but can't seem to figure out what went wrong.
Would anyone provide any solutions to this please?
I have been working on this for weeks now and I am still really stuck and would greatly appreciate any tips.
This is my code:
Odata<-read.csv("Occu_data2.csv")
> y<-Odata[,c(1,8)]
> site.covs<-Odata[,c(2,3)]
> obs.cond<- list(Odata[,c(11:13)])
> str(y)
'data.frame': 3024 obs. of 2 variables:
$ Site: Factor w/ 7 levels "Site2","Site3",..: 1 1 1 1 1 1 1 1 1 1 ...
$ Y1 : int 0 0 0 0 0 0 0 1 0 0 ...
> str(site.covs)
'data.frame': 3024 obs. of 2 variables:
$ Treatment : Factor w/ 2 levels "Control","Road": 2 2 2 2 2 2 2 2 2 2 ...
$ Road.width: num 6 6 6 6 6 6 6 6 6 6 ...
> str(obs.cond)
List of 1
$ :'data.frame': 3024 obs. of 3 variables:
..$ Species: Factor w/ 8 levels "BS","DTT","LTG",..: NA NA NA NA NA NA NA 8 NA NA ...
..$ Sex : Factor w/ 2 levels "F","M": NA NA NA NA NA NA NA 2 NA NA ...
..$ Age : Factor w/ 2 levels "A","SA": NA NA NA NA NA NA NA 1 NA NA ...
> umf<-unmarkedFrameOccu(y=y, siteCovs = site.covs, obsCovs = obs.cond)
Error in unmarkedFrame(y, siteCovs, obsCovs, obsToY = diag(J), mapInfo = mapInfo) :
At least one matrix in obsCovs has incorrect number of dimensions.