acf_plot: ACF Plots

Description Usage Arguments See Also Examples

View source: R/acf.R

Description

A wrapper around stats::acf() to make easy ACF plots in the ggplot2 system.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
acf_plot(
  x,
  lag.max = NULL,
  type = c("correlation", "covariance", "partial"),
  plot = FALSE,
  na.action = na.fail,
  demean = TRUE,
  ...,
  color = "steelblue",
  fill = "black",
  alpha = 0.7,
  data = NULL
)

Arguments

x

a univariate or multivariate (not ccf) numeric time series object or a numeric vector or matrix, or an "acf" object.

lag.max

maximum lag at which to calculate the acf. Default is 10*log10(N/m) where N is the number of observations and m the number of series. Will be automatically limited to one less than the number of observations in the series.

type

character string giving the type of acf to be computed. Allowed values are "correlation" (the default), "covariance" or "partial". Will be partially matched.

plot

A logical indicating whether the original base plot graphic should be displayed. Generally this should be left to its default value of FALSE.

na.action

function to be called to handle missing values. na.pass can be used.

demean

logical. Should the covariances be about the sample means?

...

further arguments to be passed to plot.acf.

color

color of reference lines (use "transparent" to hide)

fill

fill color for ACF plot

alpha

opacity of fill for ACF plot

data

a data frame (or other object) in which to evaluate x.

See Also

stats::acf()

Examples

1
2
acf_plot(rnorm(100))
acf_plot(rnorm(100), lag.max = 100, fill = "red", alpha = 0.3, color = "forestgreen")

rpruim/CalvinBayes documentation built on April 12, 2021, 1:49 p.m.