Skip to content
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

Review helper functions #256

Open
3 of 12 tasks
peterdesmet opened this issue Jul 17, 2023 · 2 comments
Open
3 of 12 tasks

Review helper functions #256

peterdesmet opened this issue Jul 17, 2023 · 2 comments
Assignees
Milestone

Comments

@peterdesmet
Copy link
Member

peterdesmet commented Jul 17, 2023

Suggested in camtraptor July 2023 coding sprint

zzz.R contains the following helper functions. It should be reviewed if they are still necessary and/or need to be renamed.

  • zzz.R: rename to utils.R
  • check_package(): move to own check_package.R file, see Refactoring of check_package() + return TRUE instead of package + tests #247 UPDATE: function replaced by camtrapdp::check_camtrapdp().
  • check_value(): needed?
  • collapse_transformer(): can't this be done with native glue, is a separate transformer needed?
  • labelFormat_scale(): needed? Bundle plot/map related functions in in utils-plot.R?
  • get_dep_no_obs(): needed? Could this be done as part of filter_observations()?
  • calc_daily_effort(): needed? rename to daily_effort()?
  • predict_r(): needed? rename to predict_radial_distance()?
  • map_legend_title(): needed? rename? Bundle plot/map related functions in in utils-plot.R?
  • get_legend_title(): needed? rename? Bundle plot/map related functions in in utils-plot.R?
  • add_unit_to_legend_title(): needed? Bundle plot/map related functions in in utils-plot.R?
  • mutate_when_missing(): needed?
@peterdesmet peterdesmet added this to the v1.0 milestone Jul 17, 2023
@PietrH
Copy link
Member

PietrH commented Jul 20, 2023

collapse_transformer() is actually copied from the glue documentation: https://glue.tidyverse.org/articles/transformers.html

@damianooldoni
Copy link
Member

Great news. Thanks to notice it! Stijn used it long time ago for etn package. Since then, I am reusing in other packages if needed. At that time still a piece of code on StackOverflow I think. Happy to see it in glue package. Once working on this issue we can check if we can make use of the glue function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants