read_cr2 | R Documentation |
Reads csv files downloaded from the CR2 web page as a data frame.
read_cr2(path, by = "day", out_name = NULL)
path |
path to the csv file. |
by |
string with the time step of the series (e.g.: |
out_name |
optional. String vector with user defined variable(s) column(s) name(s). |
A data frame with the data inside the csv file. Gaps between dates are
filled with NA_real_
and duplicated rows are eliminated automatically.
# list cr2 files
list.files( system.file('extdata', package = 'hydrotoolbox'), pattern = 'cr2' )
# set path to file
path_tmax <- system.file('extdata', 'cr2_tmax_yeso_embalse.csv',
package = 'hydrotoolbox')
# read file with default colname
head( read_cr2(path = path_tmax) )
# assign a column name
head( read_cr2(path = path_tmax, out_name = 'tmax(°C)') )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.