as_refundObj.matrix: Convert matrices to dataframes for use in functional data...

View source: R/as_refundObj.matrix.R

as_refundObj.matrixR Documentation

Convert matrices to dataframes for use in functional data analyses

Description

Convert matrices to dataframes for use in functional data analyses

Usage

## S3 method for class 'matrix'
as_refundObj(obj, index = NULL, ...)

Arguments

obj

Matrix object to be converted; rows contain functional observations on subjects.

index

Time grid on which functional data are observed; defaults to NULL, which assumes an equally-spaced grid on [0,1].

...

additional arguments to be passed to methods (not used).

Value

An object of classes data.frame and refund.object, the latter of which is so far not used. Columns are id (taken from the rownames of obj, if they exist), index (with behavior described above), and value (taken from entries in obj).

Author(s)

Jeff Goldsmith jeff.goldsmith@columbia.edu

Examples



library(ggplot2)
library(refund)

cca_df = as_refundObj(DTI$cca)
ggplot(cca_df, aes(x = index, y = value, group = id)) + geom_line()



refund.shiny documentation built on Oct. 11, 2022, 1:05 a.m.