sname2ts | R Documentation |
This function takes a data.frame whose columns contains the time series of several gauging stations, along with a character representing the name of one gauging station, and extracts the time series corresponding to that station.
sname2ts(x, sname, dates=1, date.fmt = "%Y-%m-%d", var.type,
tstep.out = "daily", FUN, na.rm = TRUE, from, to)
x |
data.frame containing the complete times series of all the stations. |
sname |
Character representing the name of a station, which have to correspond to one column name in |
dates |
numeric, factor, Date object indicating how to obtain the dates corresponding to the |
date.fmt |
character indicating the format in which the dates are stored in dates, e.g. %Y-%m-%d. See |
var.type |
character representing the type of variable being plotted. Used for determining the function used for computing the monthly or/and annual values when |
tstep.out |
character that defines the time step of the desired output time series. Valid values are: |
FUN |
ONLY required when |
na.rm |
a logical value indicating whether 'NA' values should be stripped before the computation proceeds. |
from |
OPTIONAL, used for extracting a subset of values. |
to |
OPTIONAL, used for extracting a subset of values. |
zoo object
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
sname2plot
## Loading the monthly time series of precipitation within the Ebro River basin.
data(EbroPPtsMonthly)
## Annual values of temperature at the station "T9105", stored in 'EbroPPtsMonthly'.
sname2ts(EbroPPtsMonthly, sname="P9001", dates=1, FUN=sum, tstep.out="annual")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.