ABbiodiversity / wildRtrax

wildrtrax is an R package for environmental sensor data management and analytics
https://abbiodiversity.github.io/wildRtrax/
Other
8 stars 9 forks source link

duration is cut short by `.make_x` #50

Closed see24 closed 5 months ago

see24 commented 6 months ago

The .make_x function that is wrapped by wt_qpad_offsets has a step where it cuts off the last character in the task_duration. I assume there used to be a string with an unneeded character there but now it is a number and this step is dropping the last digit.

library(wildRtrax)
library(dplyr)

wt_auth()
#> Authentication into WildTrax successful.

projects <- wt_get_download_summary("PC")

dat_aru <- projects %>%
  # pick a project in boreal and with few tasks
  filter(project == "CWS-Ontario Atlas Digital Point Counts Boreal FMUs 2022") %>%
  pull(project_id) %>%
  wt_download_report(sensor_id = "ARU", reports = "main", weather_cols = FALSE)

dat_aru_clean <- dat_aru %>% wt_tidy_species(sensor = "ARU", zerofill = TRUE) %>%
  wt_replace_tmtt() %>%
  wt_make_wide()
#> Successfully downloaded the species table!

ex_row <- dat_aru_clean %>% slice(2)
ex_row$task_duration
#> [1] 300

ex_x <- wildRtrax:::.make_x(ex_row)
#> Downloading geospatial assets. This may take a moment.
ex_x$MAXDUR
#> [1] 30

Created on 2024-02-27 with reprex v2.0.2