--
You received this message because you are subscribed to the Google Groups "oSCR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_package...@googlegroups.com.
To post to this group, send email to oscr_p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/b4c9064c-1faf-43bb-aab5-e3b738de34ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi David,
Do either of the following resolve the issue:
nd <- data.frame(session=factor(1).sex=c(0,1))
nd <- data.frame(session=factor(1).sex=factor(c(0,1)))
Chris
--
You received this message because you are subscribed to the Google Groups "oSCR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_package...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/926d23f1-9373-48a6-9894-c11566b4ae60%40googlegroups.com.
Hello Manolo,
Is you provide an example of the snippet of code you are using, I can pinpoint the issue. It seems that when I coded up the get.real() function, the passing of sex info requires slightly different structure depending on type. That frustrating (for me when using it, so I can imagine its frustrating for y’all too!). It likely that, in the new year, I will have more time to devote to ironing out these wrinkles. In the meantime, here is a set of instructions that should help everyone generate newdata objects that work with the different ‘types’ in get.real():
nd1 <- data.frame(session=factor(1), sex=c(0,1))
nd2 <- data.frame(session=factor(1), sex=factor(c(0,1)))
nd3 <- data.frame(session=factor(1), sex=c("m","f"))
nd4 <- data.frame(session=factor(1), sex=factor(c("m","f")))
Density (type = “dens”):
Detection (type = “det”):
Sigma (type = “sig”):
Hope that helps! Its certainly helped me pinpoint where the fix lies! If you are interested in seeing this in practice, here is the script I used to test it out using the ocelot data:
library(oSCR)
data("ocelot")
ocelot.dat <- data2oscr(edf = edf1,
tdf = list(tdf1),
sess.col = 1,
id.col = 2,
occ.col = 3,
trap.col = 4,
sex.col = 5,
sex.nacode = "U",
K = 44,
ntraps = 21,
tdf.sep = "/")
ocelot.sf <- ocelot.dat$scrFrame
ocelot.ss <- make.ssDF(ocelot.sf, buffer = 2500, res = 250)
msex <- oSCR.fit(list(~1, ~sex, ~sex), ocelot.sf, ocelot.ss, trimS=2500) #takes 5 mins!
nd1 <- data.frame(session=factor(1), sex=c(0,1))
nd2 <- data.frame(session=factor(1), sex=factor(c(0,1)))
nd3 <- data.frame(session=factor(1), sex=c("m","f"))
nd4 <- data.frame(session=factor(1), sex=factor(c("m","f")))
get.real(msex,type = "dens", newdata = nd1)
get.real(msex,type = "dens", newdata = nd2)
get.real(msex,type = "dens", newdata = nd3)
get.real(msex,type = "dens", newdata = nd4)
get.real(msex,type = "det", newdata = nd1)
get.real(msex,type = "det", newdata = nd2)
get.real(msex,type = "det", newdata = nd3)
get.real(msex,type = "det", newdata = nd4)
get.real(msex,type = "sig", newdata = nd1)
get.real(msex,type = "sig", newdata = nd2)
get.real(msex,type = "sig", newdata = nd3)
get.real(msex,type = "sig", newdata = nd4)
Chris
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/211cdbb4-3f38-4450-8c29-d1d6f0a12538n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/6d49ff5b-b17f-493b-9f65-50e7f25e9e8fn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CANjB3vR%3DxVnFqnn0gNmMELvAfRpxb-NLwrsTC9Q%2BQWue9H3LQA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CAFWOE74b9LpRQRYejj3Ddq%3DnW712tnVKGMD6aeArpUWKaAOxmg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CANjB3vTDeLREfpQ3UJRvfbs1h-rtMBZoNsUSX%3DNdwAZ1xAfygg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/04fa7182-4877-4506-85b0-7c5aa3a860ban%40googlegroups.com.