Page cover image

R

A detailed usage guide for installing and using catch22 in R (Rcatch22).

R Usage Guide

Select a card below to access R-specific usage information.



Installation


You can install the stable version of Rcatch22 from CRAN using the following:

install.packages("Rcatch22")

Getting Started: Basic Usage

Here we outline how you can jump straight into computing catch22 features on your time series data with a basic usage example.

Expected Input

Rcatch22 expects a single univariate time series as a numeric vector with length equal to the number of points in the time series. For example, consider a time series with length 100:

library(Rcatch22)
data <- stats::rnorm(100) # your time series data

Computing catch22 features

To compute catch22 features, call the catch22_all function on your time series data as follows:

outs22 <- catch22_all(data)

Expected output

A data frame is returned with two columns: names and features as shown below

outs22
##                                          names       values
## 1                           DN_HistogramMode_5  0.432653377
## 2                          DN_HistogramMode_10  0.174395817
## 3                                    CO_f1ecac  1.865299453
...                                ...                 ...
## 21            SP_Summaries_welch_rect_centroid  1.178097245
## 22                 FC_LocalSimple_mean3_stderr  1.201213638

To access the full list of feature names, you can also run feature_list.

And that's it! You now have all the knowledge you need to apply catch22 to your time series data. To access some of the additional functionality of catch22, keep reading for advanced usage tips and examples.



Advanced Usage

Ready to explore some of the additional functionality of Rcatch22?

1. Catch24

If the location and spread of the raw time series distribution may be important for your application, you can enable catch24.

Catch24 is an extension of the original catch22 feature set to include mean and standard deviation, yielding a total of 24 time series features. An option to include the mean and standard deviation as features in addition to catch22 is available through setting the catch24 argument to TRUE:

library(Rcatch22)

x <- 1 + 0.5 * 1:1000 + arima.sim(list(ma = 0.5), n = 1000)
features <- catch22_all(x, catch24 = TRUE)

2. Computing Individual Features

If you do not wish to compute the full catch22 feature set on your time series, you can alternatively compute each feature (including mean and std. deviation) individually.

In pycatch22 each feature function can be accessed individually and takes arrays as tuples or To compute individual features in Rcatch22, you can access the feature functions using their unique names (as shown in the feature overview table). Note that feature functions are given by the feature long name e.g.,IN_AutoMutualInfoStats_40_gaussian_fmmi.

For example, let's compute the feature IN_AutoMutualInfoStats_40_gaussian_fmmi on a single univariate time series:

library(Rcatch22)
x <- 1 + 0.5 * 1:1000 + arima.sim(list(ma = 0.5), n = 1000)
f <- IN_AutoMutualInfoStats_40_gaussian_fmmi(x)

FAQ


Click one of the expandable tabs below to explore commonly asked questions about Rcatch22:

How does computational time scale as a function of time series length in Rcatch22?

With features coded in C, Rcatch22 is highly computationally efficient, scaling nearly linearly with time series size. Computation time in seconds for a range of time series lengths is presented here.

How can I submit a bug report for Rcatch22?

If you would like to submit a bug report, you can access our Bug Tracker here. For guidelines on submitting an ideal bug report, see our page on contributing to catch22.


Last updated