I am resampling my full dataset at various sampling effort scenarios to investigate how sample size affects bias and precision of Huggins closed population estimators for non-invasive hair captures of black bears (remember me JLaake? Ugh!). I need to aggregate the capture summaries for each of 100 replicates generated for each scenario. Having yet to master the ways of the R language, I can't figure out how to manipulate the "summary.ch" RMark function to get what I need. Below is the code I've started with. My replicate dataset files are named according to scenario (e.g., 10w50s = 10 weeks @ 50 samples/week analyzed) and replicate ID (e.g., 1 = replicate 1). Genius! The plan is to aggregate all 100 summaries for a given scenario into a single Excel file so I can get the capture info I need. In addition, I would like to append a column (i.e., "i") to each replicate's capture summary that identifies from which replicate it was derived prior to aggregation.
nreps=100
for( i in 1:nreps)
{
testdata =paste("Scenario10w50s",i,".txt",sep = "")
beardata =import.chdata(testdata,field.types=c("n","n","n"))
beardata.process =process.data(beardata,model="Huggins")
RepCaptureSummary =summary.ch(beardata.process,bygroup=FALSE,marray=FALSE)
}
Thanks
J Laufenberg