[R] how to sample a block

From: Spiderschwein <martin_moeller_at_gmx.de>
Date: Mon, 10 Nov 2008 04:25:41 -0800 (PST)

I want to sample a block of information.

Let's say x is a time series. Using sample(x,5) I get a random sample of length 5 from x.

Is it possible to sample consecutive observations, i.e. I sample one observation and also get the next 4 observations?

Thanks a lot!


View this message in context: http://www.nabble.com/how-to-sample-a-block-tp20418997p20418997.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 10 Nov 2008 - 12:30:14 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 Mon 10 Nov 2008 - 13:30:23 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