Extracting data from capthist object

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

Extracting data from capthist object

Postby jhumm » Sat Oct 28, 2017 12:31 pm

Hello,

I am trying to run some models in package secr to determine the extent of introduced bias from subsampling of hair sample data for a spatially explicit black bear population estimate. I have simulated a trap array and a population in secrdesign, and I have simulated a capthist object from these data. My next goal is to randomly remove captures from the generated capture history in order to simulate the subsampling strategies we are hoping to use, and then to compare model parameter estimates using these modified capture histories. Is it possible to extract relevant data from a capthist object (capture location, capture occasion, animal ID, and sex) for export to a text file or database? Any assistance with this question would be greatly appreciated.

Sincerely,

Jake Humm
jhumm
 
Posts: 5
Joined: Wed Apr 08, 2015 2:52 pm

Re: Extracting data from capthist object

Postby jhumm » Sat Oct 28, 2017 3:40 pm

I figured it out, sorry for the post. 'write.capthist' works just fine.
jhumm
 
Posts: 5
Joined: Wed Apr 08, 2015 2:52 pm

Re: Extracting data from capthist object

Postby egc » Sun Oct 29, 2017 7:12 am

This should be in the 'secr' subforum, so I'm moving this thread over.
egc
Site Admin
 
Posts: 201
Joined: Thu May 15, 2003 3:25 pm

Re: Extracting data from capthist object

Postby murray.efford » Sun Oct 29, 2017 4:01 pm

Thanks Evan.

Regarding the original post - Do you have a need to export the data? Wouldn't it be simpler to use the subset method? For example, using the builtin data set captdata and selecting 50 traps at random on occasions 1-3:
Code: Select all
randomtraps <- sample.int(dim(captdata)[3], size = 50, replace = FALSE)
CH2 <- subset(captdata, traps = randomtraps, occ = 1:3)
secr.fit(CH2)

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Extracting data from capthist object

Postby jhumm » Fri Jan 10, 2020 8:13 pm

Thank you Murray, yes that would be easiest! Sorry for the 2-year-late reply, and thanks for the advice!
jhumm
 
Posts: 5
Joined: Wed Apr 08, 2015 2:52 pm


Return to analysis help

Who is online

Users browsing this forum: No registered users and 9 guests

cron