bcgov / envair

BC ENV Air Quality Monitoring Data
Apache License 2.0
6 stars 4 forks source link

get_captures error for 2022 sparwood centennial square PM data #25

Open DonnaHaga opened 7 months ago

DonnaHaga commented 7 months ago

envair 0.4.0.600 R version 4.3.1

Trying to use get_captures on a dataframe retrieved from an importBC_data call:

data<-envair::importBC_data(parameter_or_station = c("pm25",
                                                     "pm10"),
                            years=2022,
                            use_openairformat = FALSE) %>%
  dplyr::filter(STATION_NAME=="Sparwood Centennial Square" &
                  lubridate::year(DATE_PST)==2022)

captures<-envair::get_captures(param=data,
                               years = 2022)

Produces this error: 2024-01-19 get_captures

ZoeGao218 commented 6 months ago

envair version: 0.4.0.800

Hi Donna, get_captures() has been superseded by the function get_data_completeness().

Try the following codes: capture <- envair :: get_data_completeness(param = 'PM2.5', years = 2022)

names(capture) [1] "annual_hour" "annual_days" "quarter_days" "quarter_q2+q3"

There are four tables under "capture", you can choose one and filter it by station_name.

capture$annual_hour %>% dplyr :: filter(station_name == "Sparwood Centennial Square")

ZoeGao218 commented 6 months ago

Note: get_captures() is now working in the latest version envair v. 0.4.0.900. It allows to retrieve data captures based on parameter and year, then filter by station. E.g. capture_Sparwood_2022 <- envair :: get_captures('PM2.5', 2022) %>% dplyr::filter(station_name == "Sparwood Centennial Square")

DonnaHaga commented 3 months ago

Thanks @ZoeGao218. I tried the above and got the same error as for #24. envair 0.4.2.100

2024-05-30 capture sparwood