read_CR2: Reads data from Explorador Climático de Chile

Description Usage Arguments Value Examples

View source: R/read_CR2.R

Description

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

Usage

1
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

1
2
3
4
5
6
# 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(ºC)', path = full_path)

hydroToolkit documentation built on July 2, 2020, 1:04 a.m.