Description Usage Arguments Value Author(s) Examples
View source: R/sairr_clean_observations.R
Function to clean and format observational data from saqgetr's
get_saq_observations
function.
1 | saq_clean_observations(df, summary = "hour", valid_only = TRUE, spread = FALSE)
|
df |
Tibble/data frame from |
summary |
Summary to filter data to. Default is |
valid_only |
Should only valid observations be kept? |
spread |
Should the data be "spread" where the data frame is reshaped so pollutants form variables/columns. This format is usually what is desired when using openair. |
Tibble.
Stuart K. Grange
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Load a site's data
data_hafodyrynys <- get_saq_observations(
site = "gb1038a",
start = 2018,
end = 2018
)
# Keep only valid and hourly data
data_hafodyrynys_hourly <- data_hafodyrynys %>%
saq_clean_observations(summary = "hour", valid_only = TRUE) %>%
print()
# Spread hourly data, a different table format here
data_hafodyrynys_hourly_spread <- data_hafodyrynys %>%
saq_clean_observations(summary = "hour", valid_only = TRUE, spread = TRUE) %>%
print()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.