-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_n_obs()
does not seem to work for WI dp (because sequenceID==NA
?)
#167
Comments
Hi @Rafnuss! Thanks for reporting your issues with the package. However, as you said, seqeunceID equal to NA should result to library(dplyr)
library(camtraptor)
n_obs1 <- get_n_obs(mica1)
n_obs <- get_n_obs(mica)
n_obs1 %>%
filter(n > 0)
#> # A tibble: 9 × 3
#> deploymentID scientificName n
#> <chr> <chr> <int>
#> 1 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Anas strepera 1
#> 2 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Anas platyrhynchos 1
#> 3 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Castor fiber 1
#> 4 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Mustela putorius 1
#> 5 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Vulpes vulpes 1
#> 6 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Martes foina 1
#> 7 62c200a9-0e03-4495-bcd8-032944f6f5a1 Ardea cinerea 1
#> 8 62c200a9-0e03-4495-bcd8-032944f6f5a1 Ardea 1
#> 9 7ca633fa-64f8-4cfc-a628-6b0c419056d7 Homo sapiens 1
n_obs %>%
filter(n > 0)
#> # A tibble: 9 × 3
#> deploymentID scientificName n
#> <chr> <chr> <int>
#> 1 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Anas strepera 3
#> 2 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Anas platyrhynchos 4
#> 3 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Castor fiber 1
#> 4 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Mustela putorius 3
#> 5 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Vulpes vulpes 1
#> 6 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Martes foina 1
#> 7 62c200a9-0e03-4495-bcd8-032944f6f5a1 Ardea cinerea 1
#> 8 62c200a9-0e03-4495-bcd8-032944f6f5a1 Ardea 2
#> 9 7ca633fa-64f8-4cfc-a628-6b0c419056d7 Homo sapiens 1
n_obs1 %>%
filter(n == 0)
#> # A tibble: 27 × 3
#> deploymentID scientificName n
#> <chr> <chr> <int>
#> 1 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Castor fiber 0
#> 2 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Mustela putorius 0
#> 3 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Vulpes vulpes 0
#> 4 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Martes foina 0
#> 5 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Ardea cinerea 0
#> 6 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Ardea 0
#> 7 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 Homo sapiens 0
#> 8 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Anas strepera 0
#> 9 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Anas platyrhynchos 0
#> 10 577b543a-2cf1-4b23-b6d2-cda7e2eac372 Ardea cinerea 0
#> # … with 17 more rows
# all observations per deployment
n_obs_all <- get_n_obs(mica, species = NULL)
n_obs_all
#> # A tibble: 4 × 2
#> deploymentID n
#> <chr> <int>
#> 1 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 10
#> 2 577b543a-2cf1-4b23-b6d2-cda7e2eac372 9
#> 3 62c200a9-0e03-4495-bcd8-032944f6f5a1 5
#> 4 7ca633fa-64f8-4cfc-a628-6b0c419056d7 3
n_obs_all1 <- get_n_obs(mica1, species = NULL)
n_obs_all1
#> # A tibble: 4 × 2
#> deploymentID n
#> <chr> <int>
#> 1 29b7d356-4bb4-4ec4-b792-2af5cc32efa8 3
#> 2 577b543a-2cf1-4b23-b6d2-cda7e2eac372 5
#> 3 62c200a9-0e03-4495-bcd8-032944f6f5a1 3
#> 4 7ca633fa-64f8-4cfc-a628-6b0c419056d7 2 Created on 2022-09-13 with reprex v2.0.2 So, indeed, you should have some ones, not zeros... Can you provide me a reproducible example? |
Yes, that's right, I got So, I guess we should change https://github.com/inbo/camtraptor/blob/main/R/read_wi.R#L308? But see https://github.com/inbo/camtraptor/blob/main/R/read_wi.R#L145. Here is the doc on sequence vs image type: https://www.wildlifeinsights.org/get-started/basics/projects#type. I'm not really familiar with this differences and their implication for analysis. But intuitively, I would want to be able to define What would be your recommendation? |
I recommend updating |
@Rafnuss: is this solved now? |
Sorry, I didn't finished my work last time, here is the fully functional solution (ie. tested) #174 |
@Rafnuss: is this issue solved? |
Is this solved? Or do we need more tests for #174? |
@damianooldoni Is it ok to close this? |
Using
get_n_obs()
, I get really low observation counts (<20) while I have usually several hundreads of pictures per deployement.Could it be possible that this is due to NA value assigned to
sequenceID
in the import (https://github.com/inbo/camtraptor/blob/HEAD/R/read_wi.R#L326)? According to the documentation (https://inbo.github.io/camtraptor/reference/get_n_obs.html), this is how the number of observations is counted. I am however surprise that I don't get a count of 1 all the time because allsequenceID
areNA
. Any idea?The text was updated successfully, but these errors were encountered: