I have messaged you previously about my density analysis for a large leopard camera trap survey across many regions in the Western Cape. My script has evolved to include a variety of different covariates like human footprint, anthropogenic biomes, veg coverage, land cover, bioclims etc in an effort to establish a leopard density derived from environmental as well as anthropogenic factors. Ultimately I want to illustrate how leopard density is affected by various factors that may or may not create edge effects across a highly modified landscape in the Cape.
At the moment I am trying to incorporate sex as a column in the capture file with “covnames = ‘Sex’” (capitalized because its capitalized in my capture excel file!?) in the read.capthist script and “hcov = 'Sex' in the secr.fit script (because I use M, F and NA).
My script:
- Code: Select all
PP_ALLregionsCH_allCov_sex <- read.capthist(captfile = 'CAPTURE
FILES/secr_CAPS_nosex_noForest2012.csv', trapfile = 'TRAP FILES/SECR_TRAPS_INPUT_ALL_noforest2012.csv', detector = 'count', fmt = 'trapID', covnames = 'sex', trapcovnames=c('/Hft','Altitude', 'Anthro_biome', 'Ruggedness','Globecover_2009', 'Veg_NDVIAnn','SA_PA_2015','VegMap2009_biome', 'VegMap2009_Bioregion', 'SEDAC_PopDensity2015', 'LANDCOVER_WC', 'SLOPE_WC_percentage','bio8_46','bio7_46','bio2_46','bio9_46', 'bio17_46','bio15_46','bio19_46','bio6_46','bio4_46'))
- Code: Select all
secr.fit(PP_ALLregionsCH_allCov_sex, model=list(D~session, g0 ~ b), trace = FALSE, buffer=15000)
(OR)
- Code: Select all
secr.fit(PP_ALLregionsCH_allCov_sex, model = g0 ~ b, trace = FALSE, buffer=15000)
Unfortunately I am getting the error message:
- Code: Select all
Error in secr.fit(PP_ALLregionsCH_allCov, model = list(D ~ session, g0 ~ :
'verify' found errors in 'capthist' argument
In addition: Warning message:
In verify.capthist(capthist, report = 1) :
Levels of factor covariate(s) differ between sessions
If I remove all mention of sex and the column from my input file I no longer get the “Levels of factor covariate(s) differ between sessions” warning, but I am still stuck with the error:
- Code: Select all
Error in secr.fit(PP_ALLregionsCH_allCov, model = g0 ~ b, trace = FALSE, :
'verify' found errors in 'capthist' argument
I haven’t tried to split the genders into sessions because I’ve had to already divide my data into many sessions across many different regional surveys conducted. Is there a way to get around this?
I would really like to have sex used within the analysis, but I have absolutely struggled with trying all the different script options from the manuals and from other questions within this forum. Can you see what I must be doing wrong or what I have overlooked?
No matter what I do, I can't seem to shake these errors and warnings. I'd greatly appreciate your thoughts!
Best,
Carolyn (I remembered this time
