## construct capthist object MRCH from text files provided in
## 'extdata' folder, assigning attribute 'markocc' and add unmarked
## and marked sightings from respective textfiles
datadir <- system.file("extdata", package = "secr")
captfile <- paste0(datadir, '/MRCHcapt.txt')
trapfile <- paste0(datadir, '/MRCHtrap.txt')
Tufile <- paste0(datadir, '/Tu.txt')
Tmfile <- paste0(datadir, '/Tm.txt')
MRCH <- read.capthist(captfile, trapfile, detector = c("multi",
rep("proximity",4)), markocc = c(1,0,0,0,0))
MRCH1 <- addSightings(MRCH, Tufile, Tmfile)
## alternatively (ignoring marked, not ID sightings)
MRCH <- read.capthist(captfile, trapfile, detector = c("multi",
rep("proximity",4)), markocc = c(1,0,0,0,0))
Tu <- read.table(Tufile)[,-1] # drop session column
MRCH2 <- addSightings(MRCH, unmarked = Tu)
summary(MRCH2)
Run the code above in your browser using DataLab