get_saq_observations: Function to get *saqgetr* air quality observations.

View source: R/get_saq_observations.R

get_saq_observationsR Documentation

Function to get saqgetr air quality observations.

Description

Function to get saqgetr air quality observations.

Usage

get_saq_observations(
  site,
  variable = NA,
  start = NA,
  end = NA,
  valid_only = FALSE,
  tz = "UTC",
  verbose = FALSE
)

Arguments

site

A vector of sites to import. Use get_saq_sites to find what sites are available.

variable

An optional variable vector. If not used, all variables will be returned.

start

Start date for returned observations. Can either be a date string in "yyyy-mm-dd" format, or a year integer.

end

End date for returned observations. Can either be a date string in "yyyy-mm-dd" format, or a year integer.

valid_only

Should only valid observations be kept?

tz

Time zone for the observations' dates.

verbose

Should the function give messages?

Value

Tibble.

Author(s)

Stuart K. Grange.

See Also

get_saq_sites, saq_clean_observations

Examples


# Load a site's data
data_hafodyrynys <- get_saq_observations(
  site = "gb1038a", 
  start = 2018, 
  end = 2018
)

# Print tibble
print(data_hafodyrynys)



# Get multiple sites nox and ozone data for between a date range
data_many <- get_saq_observations(
  site = c("gb1014a", "gb1044a", "gb1060a"),
  variable = c("nox", "no2", "o3"),
  start = 2018,
  end = 2022,
  verbose = TRUE
)

# Print tibble
print(data_many)

# Sites and site names
data_many %>% 
  dplyr::distinct(site)
  



skgrange/saqgetr documentation built on Feb. 23, 2024, 3:17 a.m.