acfToDf {virtualPollen} | R Documentation |
It reads a vector representing a time series, applies acf
for a given number of lags
acfToDf(
x = NULL,
lag.max = 100,
length.out = 10
)
x |
numeric vector. Must represent a variable sampled at regular times. |
lag.max |
integer, number of lags over which to compute temporal autocorrelation. |
length.out |
integer, total number of lags to consider for plotting. Should be a subset of |
This function computes temporal autocorrelation of a given vector using acf
, and returns a dataframe ready for easy plotting with plotAcf
.
A dataframe with the columns: #'
lag: numeric, lag in the time units of x
with a maximum determined by lag.max
, and a number of unique values determined by length.out
acf: Pearson correlation index returned by the acf
for a given number of lags for the given lag.
ci.max: Maximum value of the confidence interval of acf
.
ci.min: Minimum value of the confidence interval of acf
.
Blas M. Benito <blasbenito@gmail.com>
#getting a driver
data(driverA)
#computing temporal autocorrelations
x.df <- acfToDf(
x = driverA,
lag.max = 1000,
length.out = 100
)
str(x.df)
#plotting output
plotAcf(x.df)