make.capthist & multi-session capture histories

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

make.capthist & multi-session capture histories

Postby peter_s » Thu Feb 01, 2018 7:30 pm

Hello,

I am trying to create multi-session capture histories using make.capthist and it is not working for me. I’ve error-checked my data and my data input formats are okay, I think. The same data works fine when I use make.capthist to generate single-session capture histories for each of my trapping grids independently. It also works fine when I use the same data to generate multi-session capture histories from exported text files with read.capthist. But when I try to create a multi-session capture history with make.capthist, I get an error that says “multi-session ‘traps’ list does not match ‘captures’”.

Here’s a simple example of what I get when I use data from two of my trapping grids to make single- or multi-session capture histories:
> ch.t11 <- make.capthist(cap.11, traps.11) # this works
> #test11 <- secr.fit(ch.t11)
>
> ch.t14 <- make.capthist(cap.14, traps.14) # this works
> #test14 <- secr.fit(ch.t14)
>
> cap.1114 <- rbind(cap.11, cap.14)
>
> ch.t1114 <- make.capthist(cap.1114, c(traps.11,traps.14)) # this doesn't work
Error in make.capthist(cap.1114, c(traps.11, traps.14)) :
multi-session 'traps' list does not match 'captures'
>
> test.ch <- read.capthist("caps11_14.csv",c("traps11.txt", "traps14.txt")) # this works
No errors found :-)
> #test.1114 <- secr.fit(test.ch)

Here’s an example of some of my data in case I am missing something with data formatting:
> head(cap.1114)
Session ID Occasion Detector
258 U11 15074 1 T11A3
259 U11 15027 1 T11A6
260 U11 15063 1 T11A7
262 U11 15072 1 T11B3
263 U11 15039 1 T11B6
264 U11 15061 1 T11B7
> head(traps.11)
x y
T11A1 606789.2 4851634
T11A2 606789.2 4851594
T11A3 606789.2 4851554
T11A4 606789.2 4851514
T11A5 606789.2 4851474
T11A6 606789.2 4851434

This seems like it should be simple and I may be missing something obvious, but I sure can’t figure it out…

Thanks!

Peter
peter_s
 
Posts: 4
Joined: Mon Mar 23, 2015 12:18 pm

Re: make.capthist & multi-session capture histories

Postby murray.efford » Thu Feb 01, 2018 10:14 pm

http://www.otago.ac.nz/density/pdfs/secr-multisession.pdf:
"For make.capthist, the ‘traps’ argument may be a list of traps objects, one per session."
Hence
Code: Select all
ch.t1114 <- make.capthist(cap.1114, list(traps.11,traps.14))

Even R sometimes uses 'list' for a vector of elements, but here list means list.
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: make.capthist & multi-session capture histories

Postby peter_s » Fri Feb 02, 2018 12:18 pm

Thanks very much Murray!

I figured it was something simple.

Peter
peter_s
 
Posts: 4
Joined: Mon Mar 23, 2015 12:18 pm


Return to analysis help

Who is online

Users browsing this forum: No registered users and 1 guest

cron