acfToDf {virtualPollen}R Documentation

Computes temporal autocorrelation in a vector, and returns a dataframe for easy plotting.

Description

It reads a vector representing a time series, applies acf for a given number of lags

Usage

acfToDf(
  x = NULL,
  lag.max = 100,
  length.out = 10
  )

Arguments

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 lag.max.

Details

This function computes temporal autocorrelation of a given vector using acf, and returns a dataframe ready for easy plotting with plotAcf.

Value

A dataframe with the columns: #'

Author(s)

Blas M. Benito <blasbenito@gmail.com>

See Also

acf, plotAcf

Examples


#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)


[Package virtualPollen version 1.0.1 Index]