[R] downsampling

Michael Knudsen micknudsen at gmail.com
Fri Jul 24 10:03:13 CEST 2009


On Fri, Jul 24, 2009 at 9:32 AM, Jan Wiener<jan.wiener at tuebingen.mpg.de> wrote:

> x=sample(1:5, 115, replace=TRUE)
>
> How do I downsample this vector to 100 entries? Are there any R functions or packages that provide such functionality.

What exactly do you mean by downsampling? Do you just want to sample
100 random entries from x?

sample(sample(1:5,115,replace=TRUE),100,replace=FALSE))

-- 
Michael Knudsen
micknudsen at gmail.com
http://lifeofknudsen.blogspot.com/




More information about the R-help mailing list