Learn R Programming

hydroToolkit (version 0.1.0)

read_CR2: Reads data from Explorador Clim<U+00E1>tico de Chile

Description

Reads data downloaded from Explorador Climatico de Chile (CR2) as a data frame.

Usage

read_CR2(file, colName, path = NULL)

Arguments

file

string with the file name (include extension). The only accepted format is '.csv'.

colName

string with the name of the variable.

path

string with the files directory. If not provided, the function will use the current working directory.

Value

A two column data frame with date and variable. Gaps between dates are filled with NA_real_ and duplicated rows are eliminated automatically.

Examples

Run this code
# NOT RUN {
# Relative path to raw data
full_path <- system.file('extdata', package = "hydroToolkit")

# Apply function
yeso_tmed <- read_CR2(file = 'Tmed_Yeso_Embalse.csv', 
                colName = 'T(<U+00BA>C)', path = full_path)


# }

Run the code above in your browser using DataLab