-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use filter functions/remove args from functions #331
Conversation
Forgotten to remove datapkg in tests. This solve that problem definitely.
Slightly related to #237
See #330. If needed for other dplyr functions, we will add it back later.
Obsolete: filter predicates are not present anymore. Filtering deployments will be discussed in another vignette, see #320
…no observations Notice that assignment function must still be implemented (it will be done in another branch/PR), see #328.
Filtering by `filter_observations()` if needed.
Thanks @sannegovaert! I will screen and reply to your comments, one by one, of course. |
Co-Authored-By: Sanne Govaert <[email protected]>
No functions with such scope anymore in camtraptor.
Better for testing lifecycle deprecation warnings.
R/get_scientific_name.R
Outdated
if (is.null(x) & !is.name(datapkg)) { | ||
x <- datapkg | ||
if (is.null(x) & !is.name(example_dataset)) { | ||
x <- example_dataset |
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.
Using example_dataset()
is not the wished behavior.
See get_scientific_name()
in main
:
get_scientific_name <- function(package = NULL,
vernacular_name,
datapkg = lifecycle::deprecated()) {
check_package(package, datapkg, "get_scientific_name")
if (is.null(package) & !is.name(datapkg)) {
package <- datapkg
}
The idea here was to use datapkg (deprecated) if package was not given.
Still, thanks to you I see that I have to remove this if ()
statement 👍
Moreover, this function will disappear in one of the next PRs. See #235.
Done in a7193bf
Co-Authored-By: Sanne Govaert <[email protected]>
Co-Authored-By: Sanne Govaert <[email protected]>
Co-Authored-By: Sanne Govaert <[email protected]>
Co-Authored-By: Sanne Govaert <[email protected]>
Thanks for addressing everything, Damiano! |
Hi @sannegovaert, thanks for checking again. Can you officially approve the PR? Thanks. |
This PR solves few issues at the same time as it was difficult to disentangle them.
map_dep()
, createmap_deployments()
(fix Renamemap_dep()
tomap_deployments()
#231). Deprecate also the argssex
andlife_stage
ofmap_dep()
. Why deprecate args of a deprecated function? Because the proposed new solutions are different: the deprecated arguments are not replaced by some args inmap_deployments()
: the user need to filter viafilter_observations()
.filter_observations()
in (deprecated)map_dep(sex, life_stage)
. Also update all examples where we show how to filter by sex and life stage viafilter_observations()
.filter_deployments()
#316): they were just abruptly removed in PR Remove predicate functions #321.get_n_species
, createn_species()
(fix Renameget_n_species()
ton_species()
#243).get_cam_op()
, createcamtrapR_cameraOperation()
(fix Renameget_cam_op()
tocamtrapR_cameraOperation()
#239).get_record_table()
, createcamtrapR_recordTable()
(fix Renameget_record_table()
tocamtrapR_recordTable()
#240).%>%
#330)round_coordinates()
(fix removeround_coordinates()
andwrite_dwc()
#327)purrr::pluck()
where needed (fix Usepurrr::pluck()
instead of$
#326)devtools::document()
)