Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.data.frame.funData

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

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

An S4 Class for Functional Data

v1.3-5
GPL-2
Authors
Clara Happ-Kurz [aut, cre]
Initial release
2020-04-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.