WACSdata {WACS} | R Documentation |
Format data for WACS
Description
WACSdata
Builds a data structure compatible with WACS functions
Usage
WACSdata(
data,
mapping = NULL,
bounds = NULL,
from = NULL,
to = NULL,
skip = NULL,
Trange = FALSE,
seasons = c("03-01", "06-01", "09-01", "12-01")
)
Arguments
data |
A dataframe containing series of values for each variable |
mapping |
The names of special variables: year, month, day, rain, tmin and tmax. Eg. list(RR = "rain", Tmin = "tmin") [optional; default is NULL] |
bounds |
A list of lists indicating the bounds for some variables eg. list(rain=list(min=0, max=7)) [optional; default is NULL] If not provided is set automatically according to data |
from |
Date at which the estimation should begin [optional; default is NULL] |
to |
Date at which the estimation should stop [optional; default is NULL] |
skip |
Vector of column names to skip[optional; default is NULL] |
Trange |
Boolean value. When
|
seasons |
Vector of string of format 'mm-dd', gives the dates of change of seasons (default: is c("03-01", "06-01", "09-01","12-01")) |
Value
A data frame structure, which will be used to call WACSestim, the function that estimates the parameters of the statistical model.
Note
bounds
can be provided as a list, as shown above. If bounds=NULL
, bounds are computed from the data. Some variables will have minimal values set automatically to 0
(trange,V,RG,ETPP
) and maximal values to 100 (ETPP
). Other minimum (resp. maximum) values are computed by adding (resp. subtracting) to
the maximum (resp. minimum value) its difference to the 10th largest (resp. lowest) value.
from
and to
must be provided with format 'yyyy-mm-dd' (e.g. '2012-01-30').
There can be as many seasons as desired, with unequal length. There can also be one single season, in which case a single date is entered.
Default is seasons = c("03-01","06-01","09-01","12-01")
.
Author(s)
D. Allard, BioSP, Ronan Trépos MIA-T, INRA
Examples
## Not run:
## Simple example
ThisData = WACSdata(ClimateSeries,from="1995-01-01",to="2012-12-31",
Trange=F,seasons=c("03-01","06-01","09-01","12-01"))
## End(Not run)