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

get_captures error for 2022 sparwood centennial square PM data #25

Open
DonnaHaga opened this issue Jan 19, 2024 · 3 comments
Open

get_captures error for 2022 sparwood centennial square PM data #25

DonnaHaga opened this issue Jan 19, 2024 · 3 comments

Comments

@DonnaHaga
Copy link

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Author

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

2024-05-30 capture sparwood

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