The crqa, R package, allows users to conduct a wide range of recurrence-based analyses on single (e.g., auto-recurrence) and multivariate time series (e.g., multidimensional cross-recurrence quantification), examine coupling properties underlying leader-follower relationships (i.e., diagonal-profile methods), as well as, track the evolution of recurrence rate over the time course (i.e., windowed methods).

```
# You can install the latest version of crqa on CRAN by running:
install.packages("crqa")
# Or for the development version from GitHub:
# install.packages("devtools")
::install_github("morenococo/crqa") devtools
```

crqa comes with some data that can be used to test and study the different functions therein.

`data(crqa) # load the data `

First, specify the arguments that will be used in the crqa, core function.

```
## parameter setting
= 1; embed = 1; rescale = 0; radius = 0.0001;
delay = 0; mindiagline = 2; minvertline = 2;
normalize = 1; whiteline = FALSE; recpt = FALSE;
tw = "both"; method = 'rqa'; metric = 'euclidean';
side = "categorical" datatype
```

Then, run crqa on a nursery rhyme “The wheels on the bus” by Verna Hills: a vector of 120 strings (i.e., the words of the song),

```
= crqa(text, text, delay, embed, rescale, radius, normalize,
ans
mindiagline, minvertline, tw, whiteline, recpt, side, method, metric, datatype)
```

Have a look at the output, which contains different measures extracted from the recurrence plot (RP), and the RP itself, which can be plotted using the plotRP function.

`str(ans)`

Cross-recurrence extends univariate recurrence analysis into a bivariate analysis that allows quantification of the temporal coupling properties of two time series. We use eye-tracking data, 2,000 observations of six possible screen locations that are looked at by a dyad engaged into a joint task.

```
= eyemovement$listener
listener = eyemovement$narrator
narrator
= 1; embed = 1; rescale = 0; radius = .01;
delay = 0; mindiagline = 2; minvertline = 2;
normalize = 0; whiteline = FALSE; recpt = FALSE; side = "both"
tw = 'crqa'; metric = 'euclidean';
method = "categorical"
datatype
= crqa(narrator, listener, delay, embed, rescale, radius, normalize,
ans
mindiagline, minvertline, tw, whiteline, recpt, side, method, metric, datatype)
```

From cross-recurrence plots is possible to extract the diagonal cross-recurrence profiles (DCRPs) and use them to capture leader-follower-relationships.

```
= round( seq(-3300,3300,33)/1000, digit = 2) ## construct the time-course for the diagonal profile
timecourse
= drpfromts(narrator, listener, windowsize = 100,
res radius = 0.001, delay = 1, embed = 1, rescale = 0,
normalize = 0, mindiagline = 2, minvertline = 2,
tw = 0, whiteline = F, recpt = F, side = 'both',
method = 'crqa', metric = 'euclidean',
datatype = 'continuous')
## visualise the diagonal-profile
= res$profile*100 ## extract it from the res object
profile
plot(timecourse, profile, type = "l", lwd = 2.5, xlab = "Lag (seconds)",
ylab = "Recurrence Rate %")
```

Multidimensional cross-recurrence quantification analysis allows for the computation of cross-recurrences between two multidimensional time-series. We use hand-movement data from a complex LEGO joint construction task. The dataframe comprises of 5,799 observations.

```
# reduce the dimensionality of the time series to make the computation faster
# handset = handmovement[1:3000, ]
= handmovement[1:1000, ]
handset
= cbind(handset$P1_TT_d, handset$P1_TT_n)
P1 = cbind(handset$P2_TT_d, handset$P2_TT_n)
P2
= 5; embed = 2; rescale = 0; radius = .1;
delay = 0; mindiagline = 10; minvertline = 10;
normalize = 0; whiteline = FALSE; recpt = FALSE; side = "both"
tw = 'mdcrqa'; metric = 'euclidean';
method = "continuous"
datatype
= crqa(P1, P2, delay, embed, rescale, radius, normalize,
ans
mindiagline, minvertline, tw, whiteline, recpt, side, method, metric,
datatype)
= ans$RP
RP = unlist(ans[1:10])
results print(results)
```

**Moreno I Coco**-*role = [cre, aut]*- (moreno.cocoi@gmail.com)**Dan Mønster**-*role = [aut]*- (danm@econ.au.dk)**Giuseppe Leonardi**-*role = [aut]*- (g.leonardi@vizja.pl)**Rick Dale**-*role = [aut]*- (rdale@ucla.edu)**Sebastian Wallot**- *role = [aut] - (sebastian.wallot@ae.mpg.de)

**James D. Dixon**-*role = [ctb]*- (james.dixon@uconn.edu)**John C. Nash**-*role = [ctb]*- (nashjc@uottawa.ca)