WACSdata: Format data for WACS

Description Usage Arguments Value Note Author(s) Examples

View source: R/WACSdata.R

Description

WACSdata Builds a data structure compatible with WACS functions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 Trange=TRUE, the couple (tmin, trange=tmax-tmin) is modeled. When Trange=FALSE, he couple (tmin, tmax) is modeled. Default is Trange=FALSE

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

1
2
3
4
5
6
7
## 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)
 

WACS documentation built on July 1, 2020, 5:22 p.m.

Related to WACSdata in WACS...