I have edf and tdf from scrbook that work fine, but won't read into oSCR helper function. Getting some traps in edf not showing up in tdf. They are there, so something else not working. I have fewer encounters than traps, so wondering if that is throwing the error? I tried converting session.id to factors, still no joy. Any advice would be appreciated.Brian
--
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/f5cce0b5-6814-4398-a090-23de267f4291%40googlegroups.com.
Hi Brian,
The following is not tested, but should be about what you need to identify the culprit.
If this is single session data, then you can use the following to
#change object (edf, tdf) and column names (trap) to match your data
edf$trap[!which(edf$trap %in% tdf$trap)]
If it’s multi-session, throw it in a loop:
#change object and column names to match your data
#also, there is a tdf per session, so let’s assume you wrapped them in a list:
tdf.ls <- list(tdf1, tdf2,etc, )
for(i in 1:length(unique(edf$session))){
tmp.sesh <- unique(edf$session)[i]
tmp.edf <- subset(edf, session == tmp.sesh)
tmp.edf$trap[!which(tmp.edf$trap %in% tdf.ls[[i]]$trap)]
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CAE%2BwgF1PnW7UYHCMCKeDi_%2B6cxOVMtrShBxsjj4HUHg4SYzB5A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/1030749542.57985.1585937837806%40mail.yahoo.com.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/f5cce0b5-6814-4398-a090-23de267f4291%40googlegroups.com.
--
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_p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CAE%2BwgF1PnW7UYHCMCKeDi_%2B6cxOVMtrShBxsjj4HUHg4SYzB5A%40mail.gmail.com.
--
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_p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/00ac01d609de%24600cf560%242026e020%24%40gmail.com.
--
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_p...@googlegroups.com.
Hello Filipe,
When I run your code I am not abel to reproduce your error, and actually the following code works just fine:
library(oSCR)
sf <- data2oscr(edf = edf,
sess.col = 1,
id.col = 2,
occ.col = 3,
trap.col = 4,
tdf = list(tdf),
K = 104,
ntraps = nrow(tdf))$scrFrame
sf
# S1
# n individuals 15
# n traps 100
# n occasions 104
#
# S1
# avg caps 1.53
# avg spatial caps 1.33
# mmdm 0.03
Does your data2oscr() code look just like what I have above?
Chris
From: oscr_p...@googlegroups.com <oscr_p...@googlegroups.com> On Behalf Of Filipe Rocha
Sent: Friday, March 31, 2023 5:01 PM
To: oSCR <oscr_p...@googlegroups.com>
Subject: Re: [oscr] Problems reading my edf and tdf with data2oSCR()
Dear all,
I have the exact same issue of this topic when trey to read the edf and tdf with data2oscr. Would you mind sharing how did you fix that issue?
The message I'm getting is:
some trap names in EDF not in TDF Warning messages: 1: In xtfrm.data.frame(x) : cannot xtfrm data frames
2: In xtfrm.data.frame(x) : cannot xtfrm data frames
However, all the trap names in edf exist in tdf:
edf$trap[!which(edf$trap %in% tdf$trap)] character(0) > edf$trap %in% tdf$trap [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
I have tried to work around this issue but haven't found a solution. Could you, please assist me with this?
I attach the tdf and edf tables, in case it helps.
Thank you for your assistance!
Filipe
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/f02ac3e4-44bc-4d72-b7f2-ac9140464e3cn%40googlegroups.com.
> sf <- data2oscr(edf = edf,
+ sess.col = 1,
+ id.col = 2,
+ occ.col = 3,
+ trap.col = 4,
+ tdf = list(tdf),
+ K = 104,
+ ntraps = nrow(tdf))$scrFrame
some trap names in EDF not in TDF
Warning messages:
1: In xtfrm.data.frame(x) : cannot xtfrm data frames
2: In xtfrm.data.frame(x) : cannot xtfrm data framesYou received this message because you are subscribed to a topic in the Google Groups "oSCR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/oscr_package/9jMjmfg3Gf0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to oscr_package...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/018f01d964c9%249d5f4190%24d81dc4b0%24%40gmail.com.
Hmmm, interesting.
I’m all up to date and using the same version of oSCR as you.
Can you send me a full script.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CANHX8FR035WAcodyM_LUsNTbzcRfy4gcq25TQ8eBmMJABCOQuA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/003c01d96715%24c7dd6610%2457983230%24%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/01b6467d-1e5e-47c2-be1d-4bd3e708078fn%40googlegroups.com.
Hi everyone,
Just an update here to say that this has happened enough times to motivate me to add check to data2oscr() that ensures the EDF is a data.frame (ie. converts from a tibble). Not a huge update so I guess the recommendation for now is that if you are using the existing version of oSCR (0.42.0) make sure your edf is a data.frame not a tibble, but any future installs will do this on the fly 😊
Thanks Dan!
To view this discussion on the web visit https://groups.google.com/d/msgid/oscr_package/CANHX8FQGydtgO_X7tXass%3DLPq6_O%2BzFUy%3DYdYM9Ty4PXneKcwQ%40mail.gmail.com.