as.data.frame.funData: Coerce functional data objects to a data.frame

as.data.frame.funDataR Documentation

Coerce functional data objects to a data.frame

Description

Coerce objects of class funData, multiFunData and irregFunData to a data frame.

Usage

## S4 method for signature 'funData'
as.data.frame(x)

## S4 method for signature 'multiFunData'
as.data.frame(x)

## S4 method for signature 'irregFunData'
as.data.frame(x)

Arguments

x

The functional data object that is to be transformed to a data.frame

Value

A data frame with columns obs (gives index/name of observed curve), argvals1, ... argvalsd with d the dimension of the support and X for the observed values. One-dimensional functions have only argvals1, two-dimensional functions (images) have argvals1 and argvals2, etc.

See Also

funData, irregFunData, multiFunData, data.frame

Examples

# one-dimensional domain
f1 <- funData(argvals = 1:5, X = matrix(1:20, nrow = 4))
head(as.data.frame(f1))

# two-dimensional domain
f2 <- funData(argvals = list(1:5, 1:6), X = array(1:120, c(4,5,6)))
head(as.data.frame(f2))

# multivariate functional data
m1 <- multiFunData(f1, f2)
str(as.data.frame(m1))

# irregular functional data
i1 <- irregFunData(argvals = list(1:5, 2:4, 3:5), X = list(1:5, 2:4, -(3:1)))
head(as.data.frame(i1))

funData documentation built on May 29, 2024, 6:08 a.m.