On Dec 19, 2012, at 12:23 PM, Martin Batholdy wrote:
> Hi,
>
>
> I have a vector like:
>
> r <- runif(100)
>
> Now I would like to split r into 10 pieces (each with 10 elements) –
> but the 'pieces' should be roughly similar with regard to mean and sd.
>
> what is an efficient way to do this
Hi Martin,
Interesting question. This is not efficient, but I thought I would
post a brute force method that might be good enough. Surely someone
will have a better approach... Well we'll see. Here is a dumb,
inefficient (but workable) way:
# create the vector to be split
r <- runif(100)
# write
Hi,
I have a vector like:
r <- runif(100)
Now I would like to split r into 10 pieces (each with 10 elements) –
but the 'pieces' should be roughly similar with regard to mean and sd.
what is an efficient way to do this in R?
thanks!
__
R-help@r-pro
3 matches
Mail list logo