8000 `summarize_deployments()` · Issue #366 · inbo/camtraptor · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
summarize_deployments() #366
Open
Open
@peterdesmet

Description

@peterdesmet

Function

summarize_deployments(
  package,
  group_by = c("deploymentID", "locationID", "locationName") # Select 1 or many (not 0)
  group_time_by = c(
    "year",
    "year-jan", # Same as "year"
    "year-feb", # Start year at yyyy-02-01
    ...
    "year-dec" # Start year at yyyy-12-01
    "month",
    "month-15", # Start month at yyyy-mm-15
    "week",
    "day"
  ) # Select 0 or 1 (replaces current group_by arg)
)

Alternatively, group_by and group_time_by are combined, but then value checking becomes harder (and it's maybe more confusing to user). Or group_time_by is renamed to chunk_by, time_by and subgroup_by.

Alternative to year-jan, etc. would be to have a separate parameter group_time_start_day:

  • For year: 1 = 1st of January, 15 = 15th of January
  • For month: 1 = 1st of month, 15 = 15th of month
  • For week: ignored
  • For day: ignored

Output

Output is a df with following cols:

  • groups:
    • group_by names (e.g. locationID)
    • group_time_by name (e.g. month)
  • measures:
    • deployment_duration: effort_duration returned by get_custom_effort() Note: drops effort and unit columns, which can be calculated from the duration.

In contrast with the deprecated functions, NA groups should be listed too (cf. dplyr::group_by()), so:

locationName month deployment_duration
Bij de grote boom 2025-03-01 3100
Bij de grote boom 2025-04-01 2500
NA 2025-03-01 7000
NA 2025-04-01 5600

Deprecates

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0