-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
executable file
·95 lines (63 loc) · 4.96 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# tf <a href="https://tidyfun.github.io/tf/"><img src="https://github.com/tidyfun/tidyfun/blob/master/man/figures/logo.gif?raw=true" align="right" height="150" alt="tf website" /></a>
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![codecov.io](https://codecov.io/github/tidyfun/tf/coverage.svg?branch=main)](https://app.codecov.io/github/tidyfun/tf/branch/main/)
[![R-CMD-check](https://github.com/tidyfun/tf/actions/workflows/full-check.yaml/badge.svg)](https://github.com/tidyfun/tf/actions/workflows/full-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/tf)](https://CRAN.R-project.org/package=tf)
<!-- badges: end -->
The **`tf`** package provides necessary infrastructure for [**`tidyfun`**](https://tidyfun.github.io/tidyfun/) with minimal dependencies -- specifically: no `tidyverse`-dependencies.
The goal of **`tidyfun`**, in turn, is to provide accessible and well-documented software that **makes functional data analysis in `R` easy** -- specifically data wrangling and exploratory analysis.
**`tf`** includes definitions of new `S3` data types for vectors of
functional data and associated methods. These `tf`-vectors, with
subclasses `tfd` and `tfb`, use the [**`vctrs`**](https://vctrs.r-lib.org/)-framework, can be operated
on using most standard functions (`+`, `mean()`, `c()`, etc.) as well as
several new functions in `tf` that implement operations specific for
*functional* data (`tf_smooth`, `tf_derive`, `tf_integrate`).
**Crucially**, vectors of class `tf` can be included in data frames containing other variables, for simple and reliable data manipulation. This approach is connected to the conceptual framework in functional data analysis which assumes that _complete functions_ are the unit of observation. With `tidyfun` and `tf`, you can keep full curves alongside numeric, factor, and other observations on the same subject in one data frame.
## Installation
You can install the released version of **tf** from [CRAN](https://CRAN.R-project.org) with:
```{r, eval = FALSE}
install.packages("tf")
```
And the development version from [GitHub](https://github.com/) with:
```{r, eval = FALSE}
# install.packages("pak")
pak::pak("tidyfun/tf")
```
## Overview
**`tf`** provides:
- new **data types** for representing functional data: `tfd` & `tfb`
- arithmetic **operators** and descriptive **statistics** for such data
- basic **graphics** functions for `tf` vectors
- basic data **wrangling** for functional data: reshaping from list columns to wide to long and back, interpolating on different grids, filtering and zooming, etc.
Please see the [`tidyfun` website](https://tidyfun.github.io/tidyfun/) for the full documentation including vignettes etc.
## What does it do?
#### New vector-like data types for functional data
**`tf`** provides [new `S3`-classes for functional data](https://tidyfun.github.io/tidyfun/reference/index.html#section-tf-sub-classes-constructors-converters), either as raw data (class `tfd` for *t*idy *f*unctional *d*ata) or in basis representation (class `tfb` for *t*idy *f*unctional *b*asis data).
Such `tf`-objects can be subsetted or subassigned, computed on and summarized.
Almost all
- operators like `==`, `+` or `*`
- math functions like `sum`, `log` or `abs`
- and statistics functions like `mean` or `sd`
are defined for the vector classes defined in **`tf`** ([more](https://tidyfun.github.io/tidyfun/reference/index.html#section-arithmetic-logical-and-summary-functions)).
The `tf` objects are just 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.
[See here](https://tidyfun.github.io/tidyfun/articles/x01_tf_Vectors.html) for more information on the operations defined for `tf` vectors.
#### Methods for converting existing data to `tf` and back
**`tf`** includes functions `tfd` and `tfb` for converting matrices, data frames, etc. to `tf` vectors and back.
More data wrangling methods in a `tidyverse`-inspired way and `ggplot2`-geoms for functional data are available in [**`tidyfun`**](https://tidyfun.github.io/tidyfun/).
[See here](https://tidyfun.github.io/tidyfun/articles/x02_Conversion.html) for details on getting data into (and out of) the `tf` format.
----------------------
Found a bug? Got a question? Missing some functionality?
Please let us know so we can make it better.