process_aqs | R Documentation |
The process_aqs()
function cleans and imports raw air quality
monitoring sites from pre-generated daily CSV files, returning a single
SpatVector
or sf
object.
date
is used to filter the raw data read from csv files.
Filtered rows are then processed according to mode
argument.
Some sites report multiple measurements per day with and without
exceptional events
the internal procedure of this function keeps "Included" if there
are multiple event types per site-time.
process_aqs(
path = NULL,
date = c("2018-01-01", "2022-12-31"),
mode = c("date-location", "available-data", "location"),
data_field = "Arithmetic.Mean",
return_format = c("terra", "sf", "data.table"),
extent = NULL,
...
)
path |
character(1). Directory path to daily measurement data. |
date |
character(1 or 2). Date (1) or start and end dates (2).
Should be in |
mode |
character(1). One of
|
data_field |
character(1). Data field to extract. |
return_format |
character(1). |
extent |
numeric(4). Spatial extent of the resulting object.
The order should be |
... |
Placeholders. |
a SpatVector, sf, or data.table object depending on the return_format
Choose date
and mode
values with caution.
The function may return a massive data.table depending on the time range,
resulting in a long processing time or even a crash if data is too large
for your computing environment to process.
download_aqs()
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
## Not run:
aqs <- process_aqs(
path = "./data/aqs_daily_example.csv",
date = c("2022-12-01", "2023-01-31"),
mode = "full",
return_format = "terra"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.