read_snih: Reads data from Servicio Nacional de Información Hídrica...

Description Usage Arguments Value Examples

View source: R/ff_read_snih.R

Description

Reads excel files downloaded from the SNIH web page as a data frame.

Usage

1
read_snih(path, by, out_name = NULL)

Arguments

path

path to the xlsx file.

by

string with the time step of the series (e.g.: 'month', 'day', '6 hour', '3 hour', '1 hour', '15 min' ). If you set it as 'none', the function will ignore automatic gap filling.

out_name

optional. String vector with user defined variable(s) column(s) name(s).

Value

A data frame with the data inside the xlsx file. Gaps between dates are filled with NA_real_ and duplicated rows are eliminated automatically.

Examples

1
2
3
4
5
6
7
8
# set path to file
path_file <- system.file('extdata', 'snih_qd_guido.xlsx', package = 'hydrotoolbox')

# read daily streamflow with default column name
head( read_snih(path = path_file, by = 'day') )

# now we use the function with column name
head( read_snih(path = path_file,  by = 'day', out_name = 'qd(m3/s)') )

hydrotoolbox documentation built on July 9, 2021, 1:06 a.m.