View source: R/handle_chile_cr2.R
handle_chile_cr2 | R Documentation |
This function allows to obtain information about weather stations located in Chile as well as a data frame containing historical records of minimum and maximum temperatures from those weather stations. This function works with data downloaded from the website of the Center for Climate and Resilience Research (CR)2 sponsored by the University of Chile. The function allows to download the data (only recommended once) as well as to handle zip files previously downloaded. Data can be downloaded from the following links: minimum temperatures and maximum temperatures
handle_chile_cr2( action, begin = 19500101, end = 20180309, latitude, longitude, number_of_stations = 25, path_zip_tmin = NULL, path_zip_tmax = NULL, stations_df = NULL, keep_data = TRUE )
action |
Character string input that defines the kind of data required. There are three options for this parameter:
|
begin |
Numeric parameter in YEARMODA format. This parameter represents the initial date of the period of interest. If it is not provided, the default is established as 19500101 which correspond to the oldest date possible to use |
end |
Numeric parameter in YEARMODA format. This parameter represents the final date of the period of interest. If it is not provided, the default is established as 20180310 which corresponds to the earliest possible date that can be used for the assessment |
latitude |
Numerical input. Latitude of the site of interest in decimal format |
longitude |
Numerical input. Longitude of the site of interest in decimal format |
number_of_stations |
Numerical input. Number of stations wanted to use as closest stations to the site of interest. Default option is the value 25 |
path_zip_tmin |
Character string input. Location of the zip file containing minimum
temperatures. This input must include the name and extension of the file. Default is set to |
path_zip_tmax |
Character string input. Location of the zip file containing maximum temperatures. This input must include the name and extension of the file. Default is set to NULL so the function will download the data from the CR2 site and store the zip file in a temporary folder. If you have the data, please provide the path. This will save a bit of time. |
stations_df |
A dataframe containing the list of stations for which this function will retrieve
weather data. It is important that this dataframe be produced by this function under the action
"info_stations". The default is set to |
keep_data |
Boolean parameter indicating if the data downloaded should be deleted or not |
#handle_chile_cr2(action = "my_data", begin = 20000101, end = 20101030, # latitude = -32.8958, longitude = -71.2092, number_of_stations = 25, # path_zip_tmin = NULL, path_zip_tmax = NULL, # stations_df = NULL, keep_data = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.