Skip to contents

Downloads the Environment and Climate Change Canada NAPS hourly file for a pollutant and year (<POLLUTANT>_<year>.csv in the ECCC data catalogue) and returns it in long form, one row per station and hour, with -999 (a missing hour) dropped. Hours are hour-ending local standard time, so H01 of a date is 01:00 on that date. The same table as morie.earth.fetch_naps() in the Python package; the catalog keys naps-<pollutant>-<province>-<year> (rmorie list-datasets) call this.

Usage

morie_fetch_naps(year, pollutant = "no2", province = NULL, timeout = 600)

Arguments

year

Calendar year, e.g. 2023.

pollutant

One of "no2", "pm25", "o3", "so2", "co", "pm10".

province

Optional two-letter province or territory code ("ON"); omitted or "CA" keeps every station.

timeout

Download timeout in seconds (the Canada-wide files are large).

Value

A data.frame with station_id, station_name, latitude, longitude, province, datetime_local, value, unit.

Examples

if (FALSE) { # \dontrun{
no2 <- morie_fetch_naps(2023, "no2", province = "ON")
head(no2)
} # }