Re: [R] spilting time series

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Tue, 5 Feb 2008 20:23:34 -0200

Ops, I think is this you want

lapply(c("head", "tail"), function(.x)as.ts(apply(a, 2, .x, nrow(a)/2)))

On 05/02/2008, Henrique Dallazuanna <wwwhsd_at_gmail.com> wrote:
> Try this:
>
> lapply(split(a, rep(1:2, each=nrow(x)/2)), ts, start=start(a),
> freq=frequency(a))
>
>
> On 04/02/2008, stephen sefick <ssefick_at_gmail.com> wrote:
> > I have a time series object with two columns.
> >
> > a <- ts(x, frequency=1/15)
> > I would like to split this into two time series of the same length
> > (they are the same number of observations lined up time for time
> > already).
> >
> > --
> > Let's not spend our time and resources thinking about things that are
> > so little or so large that all they really do for us is puff us up and
> > make us feel like gods. We are mammals, and have not exhausted the
> > annoying little problems of being mammals.
> >
> > -K. Mullis
> >
> > ______________________________________________
> > R-help_at_r-project.org 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.
> >
>
>
> --
> Henrique Dallazuanna
> Curitiba-Paraná-Brasil
> 25° 25' 40" S 49° 16' 22" O
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
R-help_at_r-project.org 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 Tue 05 Feb 2008 - 22:26:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Feb 2008 - 23:30:11 GMT.

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

list of date sections of archive