Skip to content

tidyfun/refundr

Repository files navigation

refundr

Travis build status AppVeyor build status

The goal of refundr is to interface refund and tidyfun.

Installation

devtools::install_github("tidyfun/refundr")

rfr_fpca()

The rfr_fpca() function peforms fpca using functions from the refund package. The input is a tfd column.

Below are examples using the dti and chf datasets.

library(refundr)
library(tidyfun)
library(tidyverse)

# irregular data 
data(dti_df)
dti_fpca = rfr_fpca(Y = "cca", data = dti_df)

dti_df %>% 
  modelr::add_predictions(dti_fpca, var = "cca_fits") %>% 
  filter(case == "control") %>% 
  ggplot(aes(y = cca_fits)) + 
  geom_spaghetti(alpha = .4) + 
  geom_spaghetti(aes(y = cca), color = "blue", alpha = .3) + 
  facet_grid(~sex)

# regular data
data(chf_df)
dti_fpca = rfr_fpca(Y = "activity", data = chf_df)

About

Tidier regression with functional data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages