Defines a multidimensional functional data set. Constructor function of the npf.data-class.

as.npf.data() converts functional data to a npf.data-class object.

npf.data(y, min, max, lag, ylabel, ynames, dimnames)

# S3 method for class 'npf.data'
coords(x, ...)

as.npf.data(obj, ...)

# Default S3 method
as.npf.data(obj, ...)

# S3 method for class 'array'
as.npf.data(obj, ...)

# S3 method for class 'fdata'
as.npf.data(
  obj,
  ylabel = NULL,
  ynames = NULL,
  dimnames = NULL,
  tol = sqrt(.Machine$double.eps),
  ...
)

Arguments

y

numeric matrix or array; the last dimension corresponds to curves and the first ones to discretization points.

min

vector; minimum values of the discretization points (coordinates).

max

vector; maximum values of the discretization points (optional).

lag

vector; lag in each dimension (optional).

ylabel

character; name used to label the data.

ynames

character vector; names used to label the curves.

dimnames

character vector; names used to label the dimensions.

x

funcional data (npf.data-class object).

...

further arguments passed to npf.data().

obj

a functional data object.

tol

numerical tolerance used to check whether the discretization points are regularly spaced

Value

Returns an object of class npf.data (extending npsp::data.grid), a list with the arguments y, ylabel and ynames as components, and two additional components:

  • ny number of curves (sample size).

  • grid a npsp::grid.par-class object that defines the discretization points.

Details

Only one of the arguments max or lag must be specified.

See also

Examples

fd.ozone <- npf.data(ozone, dimnames = "day")
plot(fd.ozone)