Skip to content

S3 Classes and Methods for Tidy Functional Data

3packages depend
29.1Kdownloads / year
89.5%test coverage
13/13flavors OK

Overview

About

Provides S3 vector types for functional data represented on grids, in spline bases, or via functional principal components. Supports arithmetic and summary methods, plotting, derivation, integration, smoothing, registration, and data import/export for these functional vectors. Includes data-wrangling tools for re-evaluation, subsetting, sub-assignment, zooming into sub-domains, and extracting functional features such as minima, maxima, and their locations. Enables joint analysis of functional and scalar variables by integrating functional vectors into standard data frames.

Changes in 0.5.0

Internal

  • tf_rgp() no longer depends on mvtnorm or pracma. GP draws are now generated by a direct eigen-based sampler (the symmetric square root V D^{1/2} V^T of the covariance) that reproduces the previous mvtnorm::rmvnorm(method = "eigen") draws bit-for-bit under set.seed() and handles rank-deficient kernels (e.g. squared-exp with zero nugget) correctly. tf_smooth.tfd(method = "savgol") now inlines a small Savitzky–Golay filter in place of the pracma::savgol() dependency.

Bug fixes

  • tf_evaluate() no longer returns values at the wrong positions when the requested arg contains duplicates (#236).
  • tf_integrate(f, definite = FALSE) for irregular tfd with n > 1 no longer crashes; the antiderivative's per-curve grids are kept as a list (#237).
Show all changes in 0.5.0Hide the rest of the changes in 0.5.0
  • Math.tfd() / Math.tfb() now forward ... to the underlying op so round(x, digits), log(x, base), signif(x, digits), etc. honor their extra arguments instead of silently dropping them (#246).
  • tf_integrate() on irregular tfd no longer silently returns NA under default limits; for irregular input the defaults are now each curve's own observed arg range (i.e., the range of its tf_arg() values). Pass explicit lower / upper (or an extrapolating evaluator) to override (#253).

Vector-valued functional data

This release introduces first-class support for vector-valued (multivariate)

functional data -- functions whose codomain is R^d -- alongside the existing

univariate tfd/tfb classes.

  • tfd_mv() and tfb_mv(): new vctrs-based S3 classes for vector-valued functional data, holding several component functions per observation on a shared domain. Constructors accept named lists of tfd/tfb vectors or list-columns of matrices.
  • tfb_mfpc() implements multivariate functional principal component analysis (Happ & Greven, 2018) for tf_mv data: a single set of scalar scores per curve shared across all components, with vector-valued eigenfunctions. Component weighting is configurable ("inverse_variance" default, "snr", "equal", or user-supplied). New data can be projected onto a fitted basis via tf_rebase() / vec_cast(). Accessors tf_mfpc_scores(), tf_mfpc_efunctions() and the predicate is_tfb_mfpc().
  • Multivariate registration: tf_register() gains method = "srvf_mv" for jointly aligning the components of tf_mv curves via the multivariate SRVF framework, and tf_register_shape() provides elastic shape registration (rotation/translation/scale-invariant) via fdasrvf.
  • New geometry verbs for tf_mv (and where meaningful for univariate tf): tf_norm(), tf_inner(), tf_tangent(), tf_arclength().
  • Component accessors (tf_ncomp(), tf_components(), tf_component()), tf_split() / tf_combine() extensions and [/[[ methods for extracting, replacing and recombining components.
  • Function-wise scalar summaries tf_fmean(), tf_fvar() and tf_fsd() return component-wise matrices for tf_mv objects.
  • tf_interpolate(), tf_fwise(), tf_sparsify() and tf_jiggle() now have component-wise tf_mv methods; tf_sparsify() and tf_jiggle() keep shared component grids by default via same_arg = TRUE.
  • tf_where() / tf_anywhere() work on tf_mv objects with *joint* conditions across components, referenced by name (e.g. tf_where(f, x > 0 & y < 1)); there is no value column for tf_mv input. Components must share a common grid, or arg must be supplied explicitly.
  • quantile() works on tf_mv objects, returning the *component-wise* pointwise quantiles: a tf_mv with one curve per requested probability in probs, exactly as quantile.tf() does per component (na.rm / probs / type are forwarded).
  • points() works on tf_mv objects, mirroring lines.tf_mv(): in "trajectory" mode (d == 2) it overlays the paired (x(t), y(t)) points with per-curve graphical-parameter recycling; in "facet" mode it overlays each component onto the current device.
  • tf_depth() gains a tf_mv method: a weighted componentwise aggregation of the (centrality) univariate depths, with a weights argument mirroring tfb_mfpc() ("equal" default, "inverse_variance", or a numeric vector). The up-down ordering index "MHI" has no canonical vector-valued analogue and aborts with a pointer to tf_order() (#273).
  • median(), summary() and fivenum() on tf_mv now select *observed* vector-valued curves via a single joint-depth index (one curve across all components), fixing the previous component-wise "chimera" where each component could come from a different observation. Pointwise entries (mean, min/max, the central-half range) remain component-wise (#273).
  • New generic tf_order() with a tf_mv method: tf_order(f, by = "norm") (or by = <component name>) orders vector-valued curves by an explicit scalar reduction. sort(), rank() and xtfrm() remain permanently undefined for tf_mv -- there is no canonical total order on R^d -- so base sort()/order()/rank() fail fast rather than fabricate an order (#273).

Contract change

  • is_tf() now returns TRUE for tf_mv as well as univariate tfd/tfb. Code that branched on is_tf() to mean "univariate tf" should switch to the new predicate is_tf_1d().
  • "arg" and "id" are reserved and cannot be used as component names -- they collide with the grid and curve-id columns of long-format conversions.
  • Constructing a tf_mv from components with differing domains now *warns* when widening tfd components to the union domain (evaluations outside the observed range are NA) and *aborts* for tfb components, where basis evaluation outside the fitted range would extrapolate, i.e. fabricate values.
  • Component-wise operations on a tfb_mfpc (tf_smooth(), tf_derive(), tf_zoom(), tf_integrate(), mean()/sd()/var(), Summary group generics) now consistently demote to valid per-component tfb_fpc representations with a one-time warning, like arithmetic already did -- previously they silently produced objects that abort on later use.
  • tf_fmax(), tf_fmin() and tf_fmedian() on tf_mv return an n x d curves-x-components matrix like tf_fmean()/tf_fsd() (previously: a misnamed interleaved vector).
  • tfb_fpc() and tfb_mfpc() abort informatively when the input contains completely missing curves (partially missing evaluations continue to be handled by the soft-impute SVD); re-scoring new data with NA curves via tf_rebase() / vec_cast() yields NA scores and NA entries.

Tabular export of components on differing grids

  • as.data.frame.tf_mv(unnest = TRUE) gains a grids argument controlling where components are evaluated when they live on different argument grids: "union" (default, previous behavior) evaluates every component on each curve's union grid, interpolating inside the observed range; "component" evaluates each component strictly on its own grid (or on arg), so no values are fabricated where a component was not observed -- the faithful export used by tidyfun::tf_unnest(). For shared grids both agree.

More bug fixes (pre-release review)

  • Empty prototypes (tfd(), tfb(), tfd_mv(list()) and friends) carry the sentinel domain c(NA, NA) and now combine cleanly with populated vectors in all vctrs paths (vec_c(), vec_rbind(), c(), casts) -- binding rows onto an initially empty tf column works again.
  • tfb_mv() on an existing tfb_mv with an explicit basis argument re-fits in the requested basis instead of silently returning the old one; changing the basis kind converts through tfd().
  • tfb_mv()/tfb_mfpc() on raw lists/arrays route constructor arguments (arg, domain) and basis arguments to the right place instead of forwarding everything everywhere.
  • tfd_mv() on 3-d arrays keeps length-1 curve/arg margins and curve names.
  • tf_derive() and tf_integrate() on tf_mv accept per-component arg lists, consistent with tf_interpolate().
  • Summary group generics on tf_mv no longer recycle NA masks across operands of different lengths.
  • tf_arclength(): method = "polyline" honors lower/upper without creating near-duplicate vertices, and method = "derive" no longer NA-poisons irregular curves that do not span the full domain.
  • Indefinite tf_integrate() on irregular tfd snaps user-supplied limits to (almost-)coinciding grid points instead of constructing invalid objects.
  • tf_register() works for tf_mv inputs whose components live on different grids; tf_register_shape() returns a user-supplied template unchanged from tf_template(); single-component srvf_mv delegates to univariate elastic registration and template-free single-curve registration is rejected with an explanation instead of crashing inside fdasrvf.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.3 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-04
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-04-09
  • WARNING12 OK, 2 WARNING2026-04-07
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.5.0
READMEYes · 649 wordsVignettesNoNEWSYes · 100% structured · mentions 0.5.0Citation fileNoWebsiteYes · pkgdown
Help pages
58 (4 internal)includes a package overview page
Examples that run
95%52 run in a plain check (4 of them under a condition) · 3 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
98%
Documented parameters
98%
Return-value docs
100%
Help pages citing references
16%

Downloads

29.1K
CRAN downloads in the past year
Rank #2,891 · ~80/day · ~2.4K/mo
Daily download trend is not available in this view yet.
1.5K30 days
4.9K90 days
29.1K1 year
Compare downloads with other packages →
Also on178 r2u6 autocran

Repository

tidyfun/tf ↗Organization: tidyfun
8Stars
3Forks
15Open issues
0Open PRs
4Releases
1,507Commits
8Commit identities
License file reads as AGPL-3.0 · 1,507 commits · Last activity 2026-09-03 · 0% stars, 30d · Default branch at 0.5.0.9000, ahead of CRAN 0.5.0 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
93%
Median days to close, 50 most recently updated closed issues
34
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2024-11-06 · 72026-07-07 · 8
PracticesBeta

13 development-tooling and community-health practices detected across 9 families in the upstream repository

Checks run against github.com/tidyfun/tf on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Contributing guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-03 · The repository has a site deploy workflow

pkgdown site last built 2026-07-15

Coverage (1)
Coverage reporting
Show all practicesHide 5 practices
Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
Automation and maintenance (1)
Dependabot
Lint, format, editor (1)
Air
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2025-04-22
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude
    Commits: 156 by its own account · at least 103 crediting it in the message
  • GitHub Copilotfirst seen 2026-02-19
    Pull request: opened by its own account
  • Codexfirst seen 2026-07-13
    Named in .Rbuildignore: .codex
From outside contributors
  • Claude Code
    Pull requests: 34 from outside contributors, first on 2026-02-09
Models named in its commits
  • Claude Fable 535 commits · Jun to Jul 2026
  • Claude Opus 4.813 commits · May to Jun 2026
  • Claude Fable 5.112 commits · Sep 2026
  • Claude Opus 4.612 commits · Feb to Mar 2026
  • Claude Opus 4.52 commits · Jan 2026

Some of these counts are a minimum, because the search stopped before the oldest commits.

Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
16 external dependencies (excludes base and recommended)

Installing tf adds 10 packages (9 with compiled code, 4.1 MB of source tarballs). Heaviest: vctrs 1.0 MB, rlang 766 KB, zoo 675 KB.

Depends (1)
R >= 4.1
Imports (9)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
3direct
0indirect
Depends 1 · Imports 2
Depends, Imports or LinkingTo, most downloaded first

Datasets

People & History

People (5)
Author, Maintainer since 0.3.2 (2024), Copyright holder
Author · added in 0.4.0
Contributor
Contributor
Listed in earlier versions (4)
Show 4 peopleHide 4 people
no longer listed · 0.3.2 to 0.4.1
no longer listed · 0.3.2 to 0.4.1
no longer listed · 0.3.2 to 0.4.1
Maximilian Muecke
no longer listed · 0.3.2 to 0.3.4
Releases (6)

Pick two releases to compare their code metrics.

  • 0.5.0Latest
    record
    2026-07-14 · current release · diff ↗ ·
    added 29 exports
    tf_component<-, as.tfb_mv, as.tfd_mv, fpc_wsvd, is_tf_1d, is_tf_mv, is_tfb_mfpc, is_tfb_mv, is_tfd_mv, savgol, tf_arclength, tf_component, tf_components, tf_distance, tf_inner, tf_mfpc_efunctions, tf_mfpc_scores, tf_ncomp, tf_norm, tf_order, tf_register_shape, tf_reparam_arclength, tf_rotations, tf_scales, tf_speed, tf_tangent, tfb_mfpc, tfb_mv, tfd_mv
  • R
    R 4.6.0 released · 2026-04-24
  • 0.4.1
    record
    2026-04-07 · diff ↗
  • 0.4.0
    record
    2026-03-17 · diff ↗ ·
    removed 7 exports
    vec_cast.tfb_spline, vec_cast.tfd_irreg, vec_cast.tfd_reg, vec_ptype2.tfb_fpc, vec_ptype2.tfb_spline, vec_ptype2.tfd_irreg, vec_ptype2.tfd_reg
    added 14 exports
    fivenum, rank, tf_align, tf_aligned, tf_combine, tf_estimate_warps, tf_inv_warps, tf_invert, tf_landmarks_extrema, tf_register, tf_split, tf_template, tf_warp, tfb_spline
  • R
    R 4.5.0 released · 2025-04-11
  • 0.3.4
    record
    2024-05-22 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 0.3.3
    record
    2024-03-28 · diff ↗
  • 0.3.2
    record
    2024-03-18
  • R
    R 4.3.0 released · 2023-04-21

Package metadata

First published
2024-03-18
Total releases
6 / 2 yrs
License
AGPL (>= 3) OSI
Minimum R
≥ 4.1
Bundled data
16 KB / 3 files
Download size
300 KB
Appears in task views

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("tf")
Scheipl, F., Fischer, S., Goldsmith, J., Mücke, M., & Wrobel, J. (2026). tf: S3 Classes and Methods for Tidy Functional Data (Version 0.5.0) [Computer software]. https://doi.org/10.32614/CRAN.package.tf

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for tf version 0.5.0 [Data set]. HJJB, LLC. Data release v2026-10-18. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy