Hello everyone,
I am posting my query in this thread since I have been getting the same error for my 'obsCovs' in 'occuMulti'. I hope that is alright.
My dataset consists of 33 sites sampled 5 times. I have 6 reptiles in my dataset and subsequently have species-specific 'obsCovs' for them. I tried to put these into a list. However, following are the errors I have been getting:
1.
det_covs_list = list(AFR_OBS = (obsCovs_AFR),LAGL_OBS=(obsCovs_LAGL),PMU_OBS=(obsCovs_PMU),ZVIV_OBS=(obsCovs_ZVIV),GSN_OBS=(obsCovs_GSN),SSN_OBS=(obsCovs_SSN))
> REPTILES3 <- unmarkedFrameOccuMulti(y = y_list, siteCovs = site_list, obsCovs = det_covs_list)
Error in FUN(X[[i]], ...) :
At least one element of obsCovs is not a matrix or data frame.
2. I tried to explicitly specify my species-specific obsCovs as matrices:
obsCovs = list(AFR_OBS = as.matrix(obsCovs_AFR),LAGL_OBS=as.matrix(obsCovs_LAGL),PMU_OBS=as.matrix(obsCovs_PMU),ZVIV_OBS=as.matrix(obsCovs_ZVIV),GSN_OBS=as.matrix(obsCovs_GSN),SSN_OBS=as.matrix(obsCovs_SSN))
> REPTILES3 <- unmarkedFrameOccuMulti(y = y_list, siteCovs = siteCovs, obsCovs = obsCovs)
Error: All elements of list provided to obsCovs argument must be named
3. I then tried to explicitly name all my species-specific obsCovs in a separate list:
det_covs_list = list(AFR_OBS = (obsCovs_AFR),LAGL_OBS=(obsCovs_LAGL),PMU_OBS=(obsCovs_PMU),ZVIV_OBS=(obsCovs_ZVIV),GSN_OBS=(obsCovs_GSN),SSN_OBS=(obsCovs_SSN))
> REPTILES3 <- unmarkedFrameOccuMulti(y = y_list, siteCovs = siteCovs, obsCovs = det_cov_list)
Error in FUN(X[[i]], ...) :
At least one element of obsCovs has incorrect number of dimensions.
However, the initial error returns. I am unable to locate the problem and would be delighted to receive your input.
I would be grateful for any help!
Thank you so much!
-Tanvi