EEAaq_import: Reverse function of 'EEAaq_export'. Reads an 'EEAaq_df'...

View source: R/EEAaq_import.R

EEAaq_importR Documentation

Reverse function of EEAaq_export. Reads an EEAaq_df object from a .txt or .csv file saved through EEAaq_export.

Description

Reverse function of EEAaq_export. Reads an EEAaq_df object from a .txt or .csv file saved through EEAaq_export.

Usage

EEAaq_import(file_data)

Arguments

file_data

file path of the 'csv' or 'txt' file containing the air quality data to import.

Value

No return value, called for side effects.

Examples


`%>%` <- dplyr::`%>%`
### Download PM10 data for the province (NUTS-3) of Milano (Italy)
###   from January 1st to January 31st, 2023
IDstations <- EEAaq_get_stations(byStation = TRUE, complete = FALSE)
IDstations <- IDstations %>%
                dplyr::filter(NUTS3 %in% c("Milano")) %>%
                dplyr::pull(AirQualityStationEoICode) %>%
                unique()
data <- EEAaq_get_data(IDstations = IDstations, pollutants = "PM10",
                       from = "2023-01-01", to = "2023-01-31",
                       verbose = TRUE)

### Export data to csv file
temp <- tempdir()
filepath <- paste0(temp, "/data.csv")
EEAaq_export(data = data, filepath = filepath, format = "csv")

### Import the EEAaq_df object saved in the previous code line
EEAaq_import(file_data = filepath)



EEAaq documentation built on April 3, 2025, 11:16 p.m.

Related to EEAaq_import in EEAaq...