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

Combine get_effort() and get_custom_effort() into new function effort() #236

Open
peterdesmet opened this issue Jul 13, 2023 · 1 comment
Milestone

Comments

@peterdesmet
Copy link
Member

Suggested in camtraptor July 2023 coding sprint

get_effort() returns effort information per deployment:

library(camtraptor)
get_effort(mica)
#> # A tibble: 4 × 4
#>   deploymentID                         effort unit  effort_duration       
#>   <chr>                                 <dbl> <chr> <Duration>            
#> 1 29b7d356-4bb4-4ec4-b792-2af5cc32efa8   239. hour  859859s (~1.42 weeks) 
#> 2 577b543a-2cf1-4b23-b6d2-cda7e2eac372   219. hour  786802s (~1.3 weeks)  
#> 3 62c200a9-0e03-4495-bcd8-032944f6f5a1   529. hour  1903602s (~3.15 weeks)
#> 4 7ca633fa-64f8-4cfc-a628-6b0c419056d7   335. hour  1204929s (~1.99 weeks)

get_custom_effort() returns effort information (for the entire project), per group_by unit:

``` r
library(camtraptor)
get_custom_effort(
  mica,
  group_by = "year"
)
#> # A tibble: 2 × 3
#>   begin      effort unit 
#>   <date>      <dbl> <chr>
#> 1 2019-10-09   792. hour 
#> 2 2020-10-08   529. hour

We think it would be better to combine this in one function, where deploymentID is one of the group_by variables to replicate the behaviour of get_effort:

get_custom_effort(
  package = NULL,
  # ... removed, see filters
  # start = NULL removed, see filters
  # end = NULL removed, see filters
  group_by = NULL, # options are "deploymentID", "day", "week", "month", "year"
  unit = "hour", # options are "hour", "day" (unchanged)
  # datapkg removed
)

The returned information would be:

deploymentID, day, week, month or year # not "begin", preferably column has the group_by property
effort
unit
effort_duration # exist in get_effort, not get_custom_effort, but can likely be returned for both
@jimcasaer
Copy link
Collaborator

see issue #219 -- can this be integrated / changed when creating this new function effort ?

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

2 participants