On Sun, Aug 8, 2010 at 5:54 PM, steven mosher wrote:
> z<-as.zooreg(as.ts(g))
>> z
> X12345 X34567 X56789
> 1989(1) NA 3 6
> 1989(2) NA 3 6
> 1989(3) NA 3 6
> 1989(4) NA 3 6
> 1989(5) NA 3 6
> 1989(6) NA
Thanks again,
They worked for me as well. I did a simpler example with fewer years just to
show that it worked...( shorted here for display)
f <- function(x) {
+dat <- x[-(1:2)]
+tim <- as.yearmon(outer(x$Year, seq(0, length = ncol(dat))/12,
"+"))
+zoo(c(as.matrix(dat)),
On Sun, Aug 8, 2010 at 11:55 AM, Gabor Grothendieck
wrote:
> On Sun, Aug 8, 2010 at 11:21 AM, steven mosher wrote:
>> Ok,
>> I'm a bit confused by what you mean by "regularly spaced"
>> After I do the do.call I do get a data structure with all the times present
>> and every time has a NA or a da
On Sun, Aug 8, 2010 at 11:21 AM, steven mosher wrote:
> Ok,
> I'm a bit confused by what you mean by "regularly spaced"
> After I do the do.call I do get a data structure with all the times present
> and every time has a NA or a data value.
> Steve
>
regularly spaced means that every observation
Ok,
I'm a bit confused by what you mean by "regularly spaced"
After I do the do.call I do get a data structure with all the times present
and every time has a NA or a data value.
Steve
On Sun, Aug 8, 2010 at 2:46 AM, Gabor Grothendieck
wrote:
> On Sun, Aug 8, 2010 at 2:01 AM, steven mosher
>
On Sun, Aug 8, 2010 at 2:01 AM, steven mosher wrote:
> In the real data the months are all complete, but the years can be missing.
> So years can be missing up front, in the middle, at the end. but if a year
> is present than every month has a value or NA.
> To create regular R ts I had to plow th
In the real data the months are all complete, but the years can be missing.
So years can be missing up front, in the middle, at the end. but if a year
is present than every month has a value or NA.
To create regular R ts I had to plow through the data frame, collect a year
caluculate an index to p
On Sat, Aug 7, 2010 at 9:18 PM, steven mosher wrote:
> Very Slick.
> Gabor this is a Huge speed up for me. Thanks. ha, Now I want to rewrite a
> bunch of working code.
>
>
>
> Id<-c(rep(67543,4),rep(12345,3),rep(89765,5))
> Years<-c(seq(1989,1992,by =1),1991,1993,1994,seq(1991,1995,by=1))
> Value
Very Slick.
Gabor this is a Huge speed up for me. Thanks. ha, Now I want to rewrite a
bunch of working code.
Id<-c(rep(67543,4),rep(12345,3),rep(89765,5))
Years<-c(seq(1989,1992,by =1),1991,1993,1994,seq(1991,1995,by=1))
Values2<-c(12,NA,34,21,NA,65,23,NA,13,NA,13,14)
Values<-c(12,14,34,21,5
Thanks Gabor, I probably should have done an example with fewer columns.
i will rework the example and post it up so the next guys who has this issue
can have a
clear example with a solution.
On Sat, Aug 7, 2010 at 5:04 PM, Gabor Grothendieck
wrote:
> On Sat, Aug 7, 2010 at 4:49 PM, steven mos
On Sat, Aug 7, 2010 at 4:49 PM, steven mosher wrote:
> Given a data frame, or it could be a matrix if I choose to.
> The data consists of an ID, a year, and data for all 12 months.
> Missing values are a factor AND missing years.
>
> Id<-c(rep(67543,4),rep(12345,3),rep(89765,5))
> Years<-c(seq(19
Given a data frame, or it could be a matrix if I choose to.
The data consists of an ID, a year, and data for all 12 months.
Missing values are a factor AND missing years.
Id<-c(rep(67543,4),rep(12345,3),rep(89765,5))
Years<-c(seq(1989,1992,by =1),1991,1993,1994,seq(1991,1995,by=1))
Values2<-c(12
12 matches
Mail list logo