Re: [R] Query: how to modify the plot of acf

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun 20 Aug 2006 - 05:00:14 EST

Try this. It uses Matthias' trick for getting rid of lag 1. The it defines a new local plot.acf
 and then
defines a new local plot.acf which

# test data
set.seed(1)
x <- rnorm(1000)

# run acf
x.acf <- acf(x)

# remove lag 0 -- see Matthias' post
x.acf$acf[1] <- NA

# plot with custom x axis
plot(x.acf, xaxt = "n")
axis(1, seq(12, length(x.acf$acf), 12))

On 8/18/06, Stefano Sofia <stefano.sofia@regione.marche.it> wrote:
> I need to modify the graph of the autocorrelation. I tried to do it through plot.acf but with no success.
>
> 1. I would like to get rid of the lag zero
> 2. I would like to have numbers on the x-axis only at lags 12, 24, 36, 48, 60, ...
>
> Could anybody help me in this?
>
> Any help will be appreciated
> Thank you for your attention
> Stefano
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Aug 20 06:15:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 20 Aug 2006 - 08:21:30 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.