Hi, I am looking for ways to donwsample one-dimensional vectors. For example, 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. I did find the zoo package and the aggregate() function, but these appear to be rather specific for time-series. Thanks in advance, Jan
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/