traps with no detection / absence

26 views
Skip to first unread message

Gilles Maurer

unread,
Jul 31, 2025, 8:31:00 AM7/31/25
to oSCR
Hi all, 

I have the following message when running data2oscr :
some trap names in EDF not in TDF

I checked as follows :
> trap_ids_edf <- unique(lao_edf$trapID)
> trap_ids_tdf <- unique(lao_tdf$trapID)
> missing_trapIDs <- setdiff(trap_ids_edf, trap_ids_tdf)
character (empty)
Both are set as character 
I do have 53 trapID in EDF and 2386 in TDF. 

Where could be the problem ? Any clue ? 
I am wondering if the issue may come from traps that never detect any individual ( absence only). Shall I discard them from the dataset ? 

Thank you in advance for your help
Gilles

Gilles Maurer

unread,
Jul 31, 2025, 9:42:49 AM7/31/25
to oSCR
Sorry, I did not provide sufficient details

I have one session only.
Here are data2oscr arguments :
 data <-
  data2oscr(edf = edf,
            tdf =list(tdf),
            sess.col = 1,
            id.col =2,
            occ.col = 3,
            trap.col = 4,
            sex.col = 5,
            sex.nacode = "U",
            K = 7,   # 7 occasions / only 1 session
            ntraps =  nrow(trap_operation),  #number of capture traps per session
            trapcov.names = c("habitat_class", "ob"),
            tdf.sep = "/")


Apparently when running the function data2oscr,  all trap names (53) that are in edf are not found in tdf 
> class(edf)
[1] "data.frame"
> head(edf)
  Session    ID occasion trapID sex
1       1 18UG1        1  24845   U
2       1 18UG2        1  24845   M
3       1 18UG3        1  24845   U

> head(tdf)
# A tibble: 6 × 13
  trapID       X        Y   O.1   O.2   O.3   O.4   O.5   O.6   O.7 sep   habitat_class ob
  <chr>    <dbl>    <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <fct>             <dbl>
1 20699  487482. 1969720.     0     0     0     0     0     0     1 /     Trees            0.0259
2 20854  487576. 1969545.     0     0     0     0     0     0     1 /     Trees            0.0234
3 21166  487775. 1969538.     0     0     0     0     0     0     1 /     Trees            0.0238


thank you

Daniel Linden

unread,
Jul 31, 2025, 9:43:54 AM7/31/25
to oSCR
Hi Giles, you might need to send me your files so that I can try to replicate.

Chris Sutherland

unread,
Jul 31, 2025, 9:44:51 AM7/31/25
to oSCR
Can you try again, but convert the tdf to a data frame rather than a Ribble 

--
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 visit https://groups.google.com/d/msgid/oscr_package/c812bac0-8a31-4b70-84ab-b9481c13d69bn%40googlegroups.com.

Gilles Maurer

unread,
Aug 1, 2025, 7:04:14 PM8/1/25
to oSCR
Indeed, my tdf was a tibble, I just found the answer in previous messages a minute ago. Sorry to bothered you

 I am now on my way to the sSpace ;-) that is a bit tricky because of the presence of a lake (artificial reservoir with a tricky shape and varying levels of water ). Traps are indeed visited cells were feces have been collected and genotyped.  While feces cannot be found in the water, they can be collected along the banks. And animals can cross the lake ...
 
Thks again
Gilles

PABLO PALENCIA MAYORDOMO

unread,
6:32 AM (6 hours ago) 6:32 AM
to oSCR

Dear list,

When using the 'data2oscr' function, I get the following error:

"some trap names in EDF not in TDF"

I know this is a known issue, for example in the discussion I’m responding to, as well as in other threads (e.g. Problems reading my edf and tdf with data2oSCR()).

In general, besides checking that all traps are included in the TDF, it is also recommended that both EDF and TDF are data.frame objects when passed to data2oscr. I have verified both points, but the error still persists.

I would greatly appreciate any help. I am sharing my data and code. As you will see at the end of the code, I included a small loop to try to identify any “missing” traps, but it does not seem to return any specific cases.

Thank you very much in advance for your assistance.

Best regards,
Pablo

issue_EDF_TDF.R
GlobEnv_issue_EDF_TDF_190326.RData
Reply all
Reply to author
Forward
0 new messages