View source: R/airnow_getSites_v1.R
airnow_getSites_v1 | R Documentation |
The https://airnowtech.org site provides both air pollution monitoring data as well as monitoring site location metadata. This function retrieves the most recent version of the site location metadata file and returns it as a tibble.
A description of the data format is publicly available at the Monitoring Site Fact Sheet.
airnow_getSites_v1(
url = "https://files.airnowtech.org/airnow/today/monitoring_site_locations.dat",
quiet = TRUE
)
url |
URL of the AirNow monitoring site locations file. |
quiet |
Logical passed on to
|
Tibble of AirNow site metadata.
As of October, 2021, the description above is incorrect. See the source code for this function for a correct set of field names.
As of October, 2021, the monitoring_site_locations.dat
file has
an encoding of "CP437" (aka "Non-ISO extended-ASCII" or "IBMPC 437") and will
be converted to "UTF-8" so that French and Spanish language place names are
properly encoded in the returned dataframe.
## Not run:
library(AirMonitorIngest)
# Create a directory specifically for AirNow data
dir.create("~/Data/AirNow", recursive = TRUE)
# Set logging level so messages and errors will appear in the console
MazamaCoreUtils::initializeLogging(logDir = "~/Data/AirNow")
logger.setLevel(TRACE)
# Download and parse site metadata
airnow_sites <- airnow_getSites_v1()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.