Thank you for your reply. To incorporate the detection probability, I am pasting the exact codes that I have tried.
data_list_med_withdet <- list(ylist = ylist_med,
siteCovs = all_cov_numeric_categ, obsCovs=list(effort = DetHist_list_medbody[[1]]$effort))
Now, the "all_cov_numeric_categ" contains both continuous and categorical covariates, out of which I would like to use "LULC_factors" as categorical covariates for detection probability.
modelfile_test_med_human_mod_with_det <- tempfile(fileext = ".txt")
mod.jags_test_med_human_mod_with_det <- communityModel(data_list_med,
occuCovs = list(ranef = "human_mod"),
detCovsObservation = list(fixed ="LULC_factors"),
intercepts = list(det = "ranef", occu = "ranef"),
modelFile = modelfile_test_med_human_mod_with_det)
And I found the following error message:
"Error in communityModel(data_list_med, occuCovs = list(ranef = "human_mod"), :Detection covariate LULC_factors is not a factor"
Then I also tried to add a continuous site covariate (TPI_1sqkm) as a detection site covariate.
modelfile_med_human_mod_with_det <- tempfile(fileext = ".txt")
mod.jags_med_human_mod_with_det <- communityModel(data_list_med,
occuCovs = list(ranef = "human_mod"),
detCovs = list(fixed ="TPI_1sqkm"),
intercepts = list(det = "ranef", occu = "ranef"),
modelFile = modelfile_med_human_mod_with_det)
And R gave the following warning message, but the process is running:
"Warning message:
In if (!c("obsCovs", "siteCovs") %in% names(data_list)) { :
the condition has length > 1 and only the first element will be used"
Would you please help me to understand this?