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

Update sp to sf #4

Merged
merged 34 commits into from
Sep 27, 2023
Merged

Update sp to sf #4

merged 34 commits into from
Sep 27, 2023

Conversation

tfullman
Copy link
Contributor

@tfullman tfullman commented Sep 19, 2023

Update BaBA code from reliance on sp, rgdal, and rgeos to use of sf to resolve #3

This includes multiple updates to code in the BaBA and BaRanking functions, package data, documentation and descriptions as follows:

Update BaBA code

  • Update to use sf instead of sp, raster, and rgeos
  • Update strtns function to not use adehabitatLT
  • Update movement.segment.b to use sf instead of sp spatial data formats
  • Fix median event assignment to resolve Error in median event assignment #5
  • Add fix interval rounding option
  • Add str_mean and str_sd to classification output for clearer understanding of behavior assignments
  • Simplify internal section breaks for consistency of navigation
  • Update to use pipes, consistent with BaRanking
  • Incorporate code classifying back-n-forth and trace events into the main classification loop and progress bar
  • Consolidate to a single image plotting statement

Update BaRanking code

  • Simplify functions and maintain use of sf
  • Alter the way the permeability index was calculated to yield an NA for all fence segments with total_enc < min_total_enc, rather than excluding these segments. This retains data on total encounters and number of individuals interacting with fences that may be of interest to users while still retaining the sample size constraints on the permeability index calculation. This seems in keeping with the description of the function in the help file.

Other changes

  • Update package example data to sf format
  • Tweak documentation for consistency and to incorporate the above
  • Update DESCRIPTION and NAMESPACE for consistency with the changes made above

I checked all the results of the updated functions against those from the original functions and all match exactly.

A package check with devtools::check() flagged missing documentation for the package data. Perhaps @wx-ecology could add this? The “Document your data” section of https://grasshoppermouse.github.io/posts/2017-10-18-put-your-data-in-an-r-package/ provides an example.

If these updates are accepted it would probably be good to also update the package version. Perhaps to 2.0, since this is a major switch in the underlying code, data format, and approach?

Thank you for all your great work creating this package!

tfullman and others added 4 commits September 20, 2023 16:27
@tfullman, thanks for all the work on updating the BaBA package. I am going to go ahead and accept your pull request. So I  am changing version to 2.0
@ValentineHerr ValentineHerr merged commit 47199f0 into wx-ecology:master Sep 27, 2023
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

Successfully merging this pull request may close these issues.

Error in median event assignment Update from sp to sf
2 participants