Re: [R] using acf() for multiple columns

2008-08-11 Thread Paul Gilbert
rcoder wrote: Hi Gary, Thanks for your reply. This works fine. Is there any way to send the ACF data to a matrix, so I could analyse the data in excel for e.g.? The coefficients are returned in the acf element of the result, as mentioned in the documentation (?acf). The side affect of plotti

Re: [R] using acf() for multiple columns

2008-08-07 Thread Ling, Gary (Electronic Trading)
This should do. sapply(split(A,col(A)), function(ts) acf(ts,plot=F)$acf) -gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of rcoder Sent: Thursday, August 07, 2008 4:11 AM To: r-help@r-project.org Subject: Re: [R] using acf() for multiple columns

Re: [R] using acf() for multiple columns

2008-08-07 Thread Henrique Dallazuanna
Try this: A <- matrix(rnorm(1500),nrow=500) do.call(cbind, lapply(apply(A, 2, acf, lag.max = 10), "[[", "acf")) On Thu, Aug 7, 2008 at 5:11 AM, rcoder <[EMAIL PROTECTED]> wrote: > > Hi Gary, > > Thanks for your reply. This works fine. Is there any way to send the ACF > data to a matrix, so I coul

Re: [R] using acf() for multiple columns

2008-08-07 Thread rcoder
Hi Gary, Thanks for your reply. This works fine. Is there any way to send the ACF data to a matrix, so I could analyse the data in excel for e.g.? Thanks, rcoder Ling, Gary (Electronic Trading) wrote: > > Hi, here is one possible solution ... > -gary > > ### example ### > > # cre

Re: [R] using acf() for multiple columns

2008-08-06 Thread Ling, Gary (Electronic Trading)
Hi, here is one possible solution ... -gary ### example ### # create a 500x3 multi-ts A <- matrix(rnorm(1500),nrow=500) # misc. graphical setting par(mfrow=c(ncol(A),1)) # then our friend -- lapply(split(...)) lapply(split(A,col(A)), acf) #Or lapply(split(A,col(A)), function(ts) acf(ts, lag.max