extract_fpc_scores: Extract scores from an FPC object

View source: R/fpca-utils.R

extract_fpc_scoresR Documentation

Extract scores from an FPC object

Description

This function will extract FPC scores from an object produced by rfr_fpca, and return these scores in a data frame.

Usage

extract_fpc_scores(rfr_fpca_obj)

Arguments

rfr_fpca_obj

object returned by rfr_fpca

Value

Data frame containing FPCA scores

Examples

library(refundr)
library(tidyverse)

data(dti_df)
fpca_irregular <- rfr_fpca(Y = "cca", data = dti_df)
scores <- refundr:::extract_fpc_scores(fpca_irregular)

# this gets you scores on a "new" df -- kinda messy though ...
predict(fpca_irregular, slice(dti_df, 1:10)) %>%
  refundr:::extract_fpca() %>%
  refundr:::extract_fpc_scores()


tidyfun/refunder documentation built on April 2, 2022, 2:14 a.m.