Learn R Programming

MinimumDistance (version 1.16.0)

acf2: Function for computing autocorrelations

Description

By default, this function returns the lag-10 autocorrelations of a numeric vector and omits missing values.

Usage

acf2(x, lag.max = 10, type = c("correlation", "covariance", "partial"), plot = FALSE, na.action = na.omit, demean = TRUE, ...)

Arguments

x
a numeric vector
lag.max
see acf
type
see acf
plot
logical, as in acf
na.action
ignored. Missing values are automattically omitted.
demean
logical, as in acf
...
additional arguments passed to acf

See Also

acf

Examples

Run this code
x <- rnorm(100)
x[5] <- NA
acf2(x)

Run the code above in your browser using DataLab