Learn R Programming

SpecsVerification (version 0.4-1)

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

Examples

Run this code
  # Example:
  ens <- matrix(1, nrow=2, ncol=3)
  ens.ref <- data.frame(c(1,2), c(3,NA), c(NA,NA))
  obs <- c(5,NA)
  Preprocess(ens=ens, ens.ref=ens.ref, obs=obs)

Run the code above in your browser using DataLab