-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunning_lead_lag.Rd
45 lines (39 loc) · 1.46 KB
/
running_lead_lag.Rd
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/running_lead_lag_function.R
\name{running_lead_lag}
\alias{running_lead_lag}
\title{running lead_lag analysis}
\usage{
running_lead_lag(
the_data,
s1,
s2,
neg_lag = -20,
pos_lag = 20,
win = 21,
complete = TRUE
)
}
\arguments{
\item{the_data}{A dataframe containing the timeseries. First column should contain dates.}
\item{s1}{the name of a sample - must match a column name exactly}
\item{s2}{the name of a sample - must match a column name exactly}
\item{neg_lag}{An integer}
\item{pos_lag}{An integer}
\item{win}{The window with which the running correlations are calculated over}
\item{complete}{A boolean to classify whether to run the lead-lag over the maximum range of
leads and lags between the two selected samples}
}
\description{
This function performs running lead-lag correlation analysis between two time series.
The output dataframe is used to produce the heatmaps
}
\examples{
undated_path <- system.file("extdata", "undated_example.csv", package="ringdater")
undated_data <- load_undated(undated_path)
undated_data <- name_check(undated_data)
undated <- normalise(the.data = undated_data, detrending_select = 3, splinewindow = 21)
running_lead_lag(the_data = undated, s1 = colnames(undated)[2], s2 = colnames(undated)[3],
neg_lag = -20, pos_lag = 20, win = 21, complete = FALSE)
}
\keyword{pairwise_lead_lag}