View source: R/ff_read_mnemos.R
read_mnemos | R Documentation |
Reads xlsx files generated with MNEMOS software.
read_mnemos(
path,
by = "none",
out_name = NULL,
sheet = NULL,
skip = 3,
get_sheet = FALSE
)
path |
path to the xlsx 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). |
sheet |
optional. Sheet to read. Either a string (the name of a sheet), or an integer (the position of the sheet). If neither argument specifies the sheet, defaults to the first sheet. |
skip |
optional. Minimum number of rows to skip before reading anything, be it column names or data. Leading empty rows are automatically skipped, so this is a lower bound. |
get_sheet |
logical indicating whether you want to print available variables ( |
A data frame with the data inside the specified sheet. Gaps between dates are
filled with NA_real_
and duplicated rows are eliminated automatically. In case
you set get_sheet = TRUE
the function will return a list
with the variables
inside each sheet.
# list mnemos files
list.files( system.file('extdata', package = 'hydrotoolbox'), pattern = 'mnemos' )
# set path
path <- system.file('extdata', 'mnemos_guido.xlsx', package = 'hydrotoolbox')
# we can see which variables are inside the sheet's file
read_mnemos(path = path, get_sheet = TRUE)
# now we want to read the maximum temperature
tmax_guido <- read_mnemos(path = path, by = 'day',
out_name = 'tmax(ºC)', sheet = '11413-016')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.