download_senamhi_met: Download meteorological data from SENAMHI automatic weather...

View source: R/download_senamhi_met.R

download_senamhi_metR Documentation

Download meteorological data from SENAMHI automatic weather stations.

Description

This function download the data from automatic weather station (AWS) described in aws_codes vector. It will return a complete dataset, this means that missing pollutant data from missing hour is pad out with NA.

Usage

download_senamhi_met(
  aws_codes,
  start_date,
  end_date,
  to_df = FALSE,
  to_csv = FALSE,
  verbose = TRUE,
  csv_path = ""
)

Arguments

aws_codes

A vector with station codes. See senamhi_aws().

start_date

Date to start downloading in dd/mm/yyyy.

end_date

Date to end downloading in dd/mm/yyyy.

to_df

Returns a data.frame. FALSE by default.

to_csv

Export data to csv file. FALSE by default.

verbose

Print query summary. TRUE by default.

csv_path

Location to export csv.

Value

list where each element is an air quality station data

Examples

## Not run: 
# Download meteorological data from Campo de Marte and San Borja station
# from 01/02/2022 to 02/02/2022
aws_codes <- c(112181, 112193)
start_date <- "01/02/2022"
end_date <- "02/02/2022"

cm_sb_data <- download_senamhi_met(aws_code, start_date, end_date)

## End(Not run)

quishqa/limaair documentation built on Oct. 14, 2023, 1:16 p.m.