You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For PM2.5 data for Kamloops in 2017, data returned by importBC_data() function differs if downloading the data by station (importBC_data(station, ...) vs by parameter (importBC_data("PM25", ...)). When downloaded by parameter, the data are "missing" past 2017-06-19 12:00:00. This is likely due to the fact that the monitor was switched to a SHARP; data may not be gathered from the correct ftp paths and thus appears "missing". See example below to create plots for comparison.
library(envair)
library(tidyr)
library(ggplot2)
station <- "Kamloops Federal Building"
years <- 2016:2018
# by station
dataByStation <- importBC_data(station, years = years)
xs <- dataByStation %>%
mutate(pm25_instrument = paste0("ch_PM25_", pm25_instrument),
pm25_2_instrument = paste0("ch_PM25_2_", pm25_2_instrument))
ggplot() +
geom_point(data = xs, aes(x = date, y = pm25_raw, color = pm25_instrument), alpha = 0.5) +
geom_point(data = xs, aes(x = date, y = pm25_2_raw, color = pm25_2_instrument), size = 1.5, alpha = 0.5) +
theme_bw()
# by parameter
pm25 <- importBC_data("PM25", years = years)
dataByParameter <- pm25 %>% filter(STATION_NAME == station)
xp <- pivot_wider(dataByParameter, id_cols = c("DATE_PST", "DATE", "TIME", "STATION_NAME", "NAPS_ID", "INSTRUMENT"),
names_from = "PARAMETER",
values_from = "RAW_VALUE") %>%
rename(date = DATE_PST)
ggplot() +
geom_point(data = xp, aes(x = date, y = PM25, color = INSTRUMENT), alpha = 0.5) +
theme_bw()
The text was updated successfully, but these errors were encountered:
For PM2.5 data for Kamloops in 2017, data returned by
importBC_data()
function differs if downloading the data by station (importBC_data(station, ...)
vs by parameter (importBC_data("PM25", ...)
). When downloaded by parameter, the data are "missing" past 2017-06-19 12:00:00. This is likely due to the fact that the monitor was switched to a SHARP; data may not be gathered from the correct ftp paths and thus appears "missing". See example below to create plots for comparison.The text was updated successfully, but these errors were encountered: