tidyfun makes data wrangling and exploratory analysis of functional data easier.
tidyfun provides:
- new data types for representing functional data
- arithmetic operators, descriptive statistics and graphics functions for such data
tidyverse-verbs for handling functional data inside data frames.
Look here for an introduction with examples.
devtools::install_github("fabian-s/tidyfun")tidyfun provides new S3-classes for functional data, either as raw data (class tfd for tidy functional data) or in basis representation (class tfb for tidy functional basis data).
Such tf-objects can be subsetted or subassigned, computed on and summarized.
Almost all
- operators like
==,+or* - math functions like
sum,logorabs - and statistics functions like
meanorsd
are defined for tidyfun's data structures (more).
The tf objects are basically glorified lists, so they work well as columns in data frames. That makes it a lot easier to keep your other data and functional measurements together in one object for preprocessing, exploratory analysis and description.
At the same time, these objects actually behave like vectors of functions to some extent, i.e., they can be evaluated on any point in their domain, they can be integrated or differentiated, etc.
All dplyr verbs work on tf-columns, so you can filter, mutate, summarize etc functional data pretty much like conventional data.
tidyfun also provides tf_gather & tf_spread, tf_nest & tf_unnest in order to reshape tables with functional data, i.e., go from wide to narrow, or from long to short, and vice versa (see here).
tidyfun defines pasta-themed geoms for functional data:
geom_spaghettifor lines,geom_meatballsfor (lines &) points,gglasagnafor lasagna plots, with anorder-aesthetic to sort the lasagna layers,geom_capellinifor glyphs plots (i.e., sparklines),
as well as new methods for plot, lines and points for quick and easy visualizations of functional data (more).
Found a bug? Got a question? Missing some functionality? Please let us know so we can make it better.
