-
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
Finalize n_species
, deprecate/defunct other functions, add CITATION.cff
#346
base: version-1.0
Are you sure you want to change the base?
Conversation
Added affiliation in #342 but forgot to compile documentation.
Use example without DOI and date release.
All other tests are removed as taxa is reexported from camtrapdp.
No need to have two situations in same observation data.frame
Via `cffr::cff_write()` + remove doi line
get_species is deprecated, so we needed to use another function.
Filter happens via filter_observations() now.
Infinite loop otherwise :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I have 1 remark about filtering on observationLevel & a suggestion for simplification.
# Extract observations and deployments | ||
observations <- observations(x) | ||
# Extract event-based observations and deployments | ||
observations <- observations(x) %>% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest:
x <- filter_observations(.data$observationLevel == "event")
and using observations(x)
instead of observations
.
Because what if there is a deployment with only media-based observations?
It would now not be noticed in L33: deployments_no_obs <- get_dep_no_obs(x)
.
And last, why is the count reduced by NA-values in a mutate-function, and not like this?:
n_species <-
species %>%
dplyr::filter(!is.na(.data$scientificName)) %>%
dplyr::group_by(.data$deploymentID) %>%
dplyr::count() %>%
dplyr::ungroup()
This pull request includes several changes to the codebase, focusing on:
n_species()
and its testsFinalizing
n_species()
and its testsUp to now, tests were not really taken into account as we were way far from getting the functions ready to the new format. From this PR we can start using them 🥳 as the very first function,
n_species()
, is ready! So, please rundevtools::test(filter = "n_species")
as check. Its related tests have been simplified without losing testing power. Notice that we only consider event based observations for the standard functions of camtraptor v1.0.0 (#332).Deprecation of functions
get_species()
function in favor oftaxa()
(fix Deprecateget_species()
#343)get_scientific_name()
andcheck_species()
functions are defunct in favor oftaxa()
(fix Removecheck_species()
,get_scientific_name()
#235). So,check_species()
andget_scientific_name()
functions are moved todefunct.R
.Metadata
CITATION.cff
(fix AddCITATION.cff
#345) (usingcffr::cff_write()
).Documentation updates
n_species
instead of the deprecatedget_species
. This has been done by using@inheritParams n_species
instead of@inheritParams get_n_species
.NEWS.md
file to reflect the deprecation/defunct of several functions, the introduction of new replacements and new citation file.Other code improvements
get_n_individuals()
andget_n_obs()
functions by removing thespecies
parameter and associated logic: we do not filter anymore within such functions, only viafilter_observations()
. IMPORTANT: these functions are still not finalized and do not follow the new data standard still. So, they will fail or return a non tested result.