Preprocess: Preprocess data for use with SpecsVerification.
Description
Preprocess ensemble and observation data for use with verification routines.
Usage
Preprocess(ens=NULL, ens.ref=NULL, obs=NULL)
Arguments
ens
A data.frame, vector, or matrix; or NULL (default).
ens.ref
A data.frame, vector, or matrix; or NULL (default).
obs
A data.frame, vector, or matrix; or NULL (default).
Value
The function returns a list with elements ens, ens.ref and obs.
Details
Here is roughly what the function does, in that order:
- check which of the three arguments were provided by comparing them to NULL
- check if ens and ens.ref and obs are of class `data.frame`, `numeric`, or `matrix`; otherwise stop
- vector-valued ensembles are interpreted as one K-member ensemble, rather than K 1-member ensembles
- ens and ens.ref are coerced to class `matrix` by `as.matrix`, obs to class `numeric` i.e. vector
- check whether all provided objects have the same length in the time dimension; otherwise stop
- ensemble members (i.e. columns) which have all entries NA are removed