Skip to contents

Tidy data wrangling

Converting, reshaping, and evaluating functional data inside data frames

tidyfun tidyfun-package
tidyfun: Tidy Functional Data Wrangling and Visualization
tf_gather()
Gather all columns representing functional measurements into a tfd-object
tf_spread()
Spread a tf-column into many columns representing the function evaluations.
tf_nest()
Turn "long" tables into tidy data frames with tf-objects
tf_unnest()
Turn (data frames with) tf-objects / list columns into "long" tables.
tf_evaluate(<data.frame>)
Evaluate tfs inside a data.frame

Constructors & converters (from tf)

Defining and converting functional data objects (re-exported from tf)

tfd() as.tfd() as.tfd_irreg()
Constructors for vectors of "raw" functional data (from tf)
tfd() as.tfd() as.tfd_irreg()
Constructors for vectors of "raw" functional data (from tf)
tfb() tfb_wavelet() as.tfb()
Constructors for functional data in basis representation (from tf)
tfb() tfb_wavelet() as.tfb()
Constructors for functional data in basis representation (from tf)
as.data.frame(<tf>) as.matrix(<tf>) as.function(<tf>)
Convert functional data back to tabular data formats (from tf)
tfb_spline()
Spline-based representation of functional data (from tf)
tfb_fpc()
Functional data in FPC-basis representation (from tf)
fpc_wsvd()
Eigenfunctions via weighted, regularized SVD (from tf)
tf_rebase()
Change (basis) representation of a tf-object (from tf)

Visualization with ggplot2

tf_ggplot() and standard ggplot2 geoms for spaghetti plots, ribbons, and more. Specialized geoms for heatmaps, boxplots, and sparklines.

tf_ggplot()
Create a tf-aware ggplot
is_tf_ggplot()
Check if object is a tf_ggplot
`+`(<tf_ggplot>)
Add layers to tf_ggplot objects
print(<tf_ggplot>)
Print method for tf_ggplot
ggplot_build(<tf_ggplot>)
ggplot_build method for tf_ggplot
parse_tf_aesthetics()
Parse aesthetic mappings to separate tf and regular aesthetics

Geoms and stats

ggplot2 layers for functional data

stat_tf() geom_spaghetti() geom_meatballs()
Spaghetti plots for tf objects
stat_fboxplot() geom_fboxplot()
Functional boxplots for tf objects
gglasagna()
Lasagna plots for tfs using ggplot2
stat_errorband() geom_errorband()
Error bands using tf objects as bounds
stat_capellini() geom_capellini()
Glyph plots for tf objects
autoplot(<tf>) autolayer(<tf>)
Autoplot and autolayer methods for tf objects

Visualization & display (from tf)

Base-R graphics and print formats for tf objects

plot(<tf>) lines(<tf>) points(<tf>)
base plots for tfs (from tf)
print(<tf>) print(<tfd_reg>) print(<tfd_irreg>) print(<tfb>) format(<tf>)
Pretty printing and formatting for functional data (from tf)

Display

Pillar and print formatting for tf columns

type_sum(<tf>) obj_sum(<tf>) pillar_shaft(<tf>)
Format tidy functional data for tibbles

Data

Real-world functional data sets shipped with tidyfun or tf

chf_df
Congestive heart failure accelerometry data
dti_df
Diffusion tensor imaging data
gait
Hip and knee angle while walking data (from tf)
growth
Berkeley growth study data (from tf)
pinch
Pinch force data (from tf)

Querying functional data (from tf)

Locating functional features like peaks or zero-crossings

tf_where() tf_anywhere()
Find out where functional data fulfills certain conditions. (from tf)
tf_zoom()
Functions to zoom in/out on functions (from tf)

Evaluating, indexing & re-arranging (from tf)

Accessing, appending, evaluating, splitting & combining functional data objects

`[`(<tf>) `[<-`(<tf>)
Accessing, evaluating, subsetting and subassigning tf vectors (from tf)
tf_approx_linear() tf_approx_spline() tf_approx_none() tf_approx_fill_extend() tf_approx_locf() tf_approx_nocb()
Inter- and extrapolation functions for tfd-objects (from tf)
tf_evaluate()
Evaluate tf-vectors for given argument values (from tf)
tf_interpolate()
Re-evaluate tf-objects on a new grid of argument values. (from tf)
tf_split() tf_combine()
Split / Combine functional fragments (from tf)

Arithmetic, logical and summary functions (from tf)

Functionality for computing with and comparing functional data

`==`(<tfd>) `!=`(<tfd>) `==`(<tfb>) `!=`(<tfb>) vec_arith(<tfd>) vec_arith(<tfb>) Math(<tfd>) Math(<tfb>) Summary(<tf>) cummax(<tfd>) cummin(<tfd>) cumsum(<tfd>) cumprod(<tfd>) cummax(<tfb>) cummin(<tfb>) cumsum(<tfb>) cumprod(<tfb>)
Math, Summary and Ops Methods for tf (from tf)
mean(<tf>) median(<tf>) sd() var() summary(<tf>)
Functions that summarize tf objects across argument values (from tf)
tf_fwise() tf_fmax() tf_fmin() tf_fmedian() tf_frange() tf_fmean() tf_fvar() tf_fsd() tf_crosscov() tf_crosscor()
Summarize each tf in a vector (function-wise) (from tf)
tf_depth()
Functional Data Depth (from tf)
rank() xtfrm(<tf>) sort(<tf>)
Rank, order and sort tf vectors (from tf)
min(<tf>) max(<tf>) range(<tf>)
Depth-based minimum, maximum and range for tf vectors (from tf)
fivenum()
Tukey's Five Number Summary for tf vectors (from tf)

Differentiation, integration and smoothing (from tf)

tf_derive()
Differentiating functional data: approximating derivative functions (from tf)
tf_integrate()
Integrals and anti-derivatives of functional data (from tf)
tf_smooth()
Simple smoothing of tf objects (from tf)

Registering and warping (from tf)

Functions for registering and warping functional data

tf_register()
Register / align a tf vector against a template function (from tf)
tf_estimate_warps()
Estimate warping functions for registration (from tf)
tf_aligned() tf_inv_warps() tf_template() print(<tf_registration>) summary(<tf_registration>) print(<summary.tf_registration>) plot(<tf_registration>) `[`(<tf_registration>) length(<tf_registration>)
Registration Result Object (from tf)
tf_align()
Apply warping functions to align functional data (from tf)
tf_landmarks_extrema() detect_landmarks() cluster_landmarks() build_landmark_matrix()
Find Extrema Locations in Functional Data (from tf)
tf_warp()
Elastic Deformation: warp and align tf vectors (from tf)
tf_invert()
Invert a tf vector (from tf)

Utilities & random generation (from tf)

tf_arg() tf_evaluations() tf_count() tf_domain() `tf_domain<-`() tf_evaluator() `tf_evaluator<-`() tf_basis() `tf_arg<-`() coef(<tfb>) rev(<tf>) is.na(<tf>) is.na(<tfd_irreg>) is_tf() is_tfd() is_reg() is_tfd_reg() is_irreg() is_tfd_irreg() is_tfb() is_tfb_spline() is_tfb_fpc()
Utility functions for tf-objects (from tf)
tf_rgp()
Gaussian Process random generator (from tf)
tf_jiggle() tf_sparsify()
Make a tf (more) irregular (from tf)
in_range() `%inr%`
Find out if values are inside given bounds (from tf)
ensure_list()
Turns any object into a list (from tf)
unique_id()
Make syntactically valid unique names (from tf)