Here's an example:


>  library(timeSeries)>  library(zoo)> data(MSFT)> MSFT.zoo <- as.zoo(MSFT[,"Close"])> head(MSFT.zoo)             Close
2000-09-27 60.6250
2000-09-28 61.3125
2000-09-29 60.3125
2000-10-02 59.1250
2000-10-03 56.5625
2000-10-04 55.4375> MSFT.zoo.3 <- rollmean(MSFT.zoo, 3)Error in
`colnames<-`(`*tmp*`, value = "Close") :
  attempt to set colnames on object with less than two dimensions

> packageVersion("zoo")[1] ‘1.7.4’> packageVersion("timeSeries")[1] ‘2130.92’


Thanks!
On Fri, Sep 23, 2011 at 12:11 PM, Gabor Grothendieck <
ggrothendieck@gmail.com> wrote:

>  On Fri, Sep 23, 2011 at 12:52 PM, John Kerpel <john.kerpel@gmail.com>
> wrote:
> > I'm getting the following error with rollmean from the zoo package:
> >
> >
> >> rollmean(x,k=20,align='right')Error in `colnames<-`(`*tmp*`, value =
> "T") :
> >  attempt to set colnames on object with less than two dimensions
> >
> >
> >
> > x is originally a univariate timeSeries object that is coerced to zoo
> > via as.zoo.  I've used this before without incident.  What am I doing
> > wrong?  I'm on Windows-7 64 bit, R 64-bit v2.13.1.
> >
>
> We can't really tell what is wrong unless you provide a reproducible
> example. The following is reproducible and seems to work ok:
>
> > library(timeSeries)
> Loading required package: timeDate
> > library(zoo)
> ...snip...
> > data(MSFT)
> > MSFT.zoo <- as.zoo(MSFT)
> > MSFT.zoo.3 <- rollmean(MSFT.zoo, 3)
> >
> >
> > packageVersion("zoo")
> [1] ‘1.7.4’
> > packageVersion("timeSeries")
> [1] ‘2130.92’
> > R.version.string
> [1] "R version 2.13.1 Patched (2011-09-02 r56895)"
> > win.version()
> [1] "Windows Vista (build 6002) Service Pack 2"
>
>
>
>
>
> Try displaying the output of dput(x) or show how to reconstruct it
> from scratch in a reproducible fashion.
>
>
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>

	[[alternative HTML version deleted]]

