---
title: "Introduction to Rcatch22"
author: "Trent Henderson"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Introduction to Rcatch22}
  %\VignetteEngine{knitr::knitr}
  %\usepackage[UTF-8]{inputenc}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  fig.height = 7,
  fig.width = 9
)
```

```{r, message = FALSE, warning = FALSE}
library(Rcatch22)
```

`Rcatch22` is an R package for the calculation of [22 CAnonical Time-series CHaracteristics](https://github.com/DynamicsAndNeuralSystems/catch22) (catch). The package is an efficient implementation that calculates time-series features coded in C.

## Core calculation function

The main function of the package is `catch22_all` which automates the computation of the 22 features. This can be run in a one-liner:

```{r, message = FALSE, warning = FALSE}
data <- rnorm(100)
outs <- catch22_all(data)
```

Taking a look at the returned dataframe, we can see a nice tidy data structure:

```{r, message = FALSE, warning = FALSE}
outs
```

### catch24

An option to include the mean and standard deviation as features in addition to `catch22` is available through setting the `catch24` argument to `TRUE`:

```{r, message = FALSE, warning = FALSE}
outs2 <- catch22_all(data, catch24 = TRUE)
outs2
```

## Feature list

A list of the time-series features included in `Rcatch22` can be viewed using the included `feature_list` vector:

```{r, message = FALSE, warning = FALSE}
Rcatch22::feature_list
```