read_DGI: Reads data from Departamento General de Irrigación (Mendoza -...

Description Usage Arguments Value Examples

View source: R/read_DGI.R

Description

Reads the Departamento General de Irrigacion(Mendoza - Argentina) excel sheet.

Usage

1
read_DGI(file, sheet = NULL, colName = NULL, range = NULL, path = NULL)

Arguments

file

string with the file name ('xlsx' excel files).

sheet

sheet to read. Either a string (the name of a sheet), or an integer (the position of the sheet). Default value is sheet one.

colName

string with the name of the second column (as default first column is Date). If ignored first row excel names are used.

range

string providing cell range to read. E.g.: 'A1:B75'.

path

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

Value

A data frame with two columns: 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
toscas_hr <- read_DGI(file = 'Toscas.xlsx', sheet = 'hr',
                colName = 'RH(%)', path = full_path)

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