RE: [R] ts.intersect a multivariate and univariate ts

2005-06-06 Thread Prof Brian Ripley
On Mon, 6 Jun 2005, Andy Bunn wrote: R > w <- list(rnorm(10), rnorm(10)) R > x <- ts(w, start = 1980) Even though you don't get an error message this statement is erroneous. ?ts discusses the valid possibilities. So it does, might I suggest add something like this to ts: if (is.list(dat

RE: [R] ts.intersect a multivariate and univariate ts

2005-06-06 Thread Andy Bunn
> > > > R > w <- list(rnorm(10), rnorm(10)) > > R > x <- ts(w, start = 1980) > > Even though you don't get an error message this statement is > erroneous. ?ts discusses the valid possibilities. So it does, might I suggest add something like this to ts: if (is.list(data)) stop("Data

Re: [R] ts.intersect a multivariate and univariate ts

2005-06-05 Thread Gabor Grothendieck
On 6/5/05, Andy Bunn <[EMAIL PROTECTED]> wrote: > > some_df[1, ] is actually a data frame: see ?"[.data.frame". It's hard to > > see what else it could be, as columns of a data frame are of arbitrary > > classes. > > I see, I was confusing class and mode. However, since a list can be a ts > objec

RE: [R] ts.intersect a multivariate and univariate ts

2005-06-05 Thread Andy Bunn
> some_df[1, ] is actually a data frame: see ?"[.data.frame". It's hard to > see what else it could be, as columns of a data frame are of arbitrary > classes. I see, I was confusing class and mode. However, since a list can be a ts object as in this example: R > w <- list(rnorm(10), rnorm(10)) R

RE: [R] ts.intersect a multivariate and univariate ts

2005-06-05 Thread Prof Brian Ripley
some_df[1, ] is actually a data frame: see ?"[.data.frame". It's hard to see what else it could be, as columns of a data frame are of arbitrary classes. When you apply matrix() to a data frame it gets dropped to a list. On Sat, 4 Jun 2005, Andy Bunn wrote: Adam: Providing a reproducible e

Re: [R] ts.intersect a multivariate and univariate ts

2005-06-04 Thread Gabor Grothendieck
Andy Bunn whrc.org> writes: : : Adam: : > Providing a reproducible example would be a first step... : : That's the problem, I can't. But I str has come to the rescue: We can provide it in a reproducible way like this: dput(rw) dput(pg) That will output both in a format that anyone else can p

RE: [R] ts.intersect a multivariate and univariate ts

2005-06-04 Thread Andy Bunn
Adam: > Providing a reproducible example would be a first step... That's the problem, I can't. But I str has come to the rescue: R > str(rw) Time-Series [1:307] from 1690 to 1996: 0.986 1.347 1.502 1.594 1.475 ... R > str(pg) List of 264 $ : num 0.227 $ : num 0.189 $ : num 0.237 $ : num 0.23

Re: [R] ts.intersect a multivariate and univariate ts

2005-06-03 Thread Achim Zeileis
Andy: > I have a mv ts object: > > R > tsp(pg) > [1] 1982 20031 > R > dim(pg) > [1] 22 12 > > and a univariate ts: > > R > tsp(rw) > [1] 1690 19961 > > Yet, when I try to intersect them: > > R > tsp(ts.intersect(rw, pg)) > [1] 1982 21761 > > the process goes awry. > > How to I get rw a

[R] ts.intersect a multivariate and univariate ts

2005-06-03 Thread Andy Bunn
This seems like a FAQ, but I can't figure it out. I have a mv ts object: R > tsp(pg) [1] 1982 20031 R > dim(pg) [1] 22 12 and a univariate ts: R > tsp(rw) [1] 1690 19961 Yet, when I try to intersect them: R > tsp(ts.intersect(rw, pg)) [1] 1982 21761 the process goes awry. How to