[R] rearrange set of items randomly
Greg.Snow at imail.org
Mon Nov 14 21:36:22 CET 2011
If you don't want to go with the simple method mentioned by David and Ted, or you just want some more theory, you can check out: http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle and implement that.
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
greg.snow at imail.org
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of flokke
> Sent: Monday, November 07, 2011 2:09 PM
> To: r-help at r-project.org
> Subject: [R] rearrange set of items randomly
> Dear all,
> I hope that this question is not too weird, I will try to explain it as
> as I can.
> I have to write a function for a school project and one limitation is
> that I
> may not use the in built function sample()
> At one point in the function I would like to resample/rearrange the
> items of
> my sample (so I would want to use sample, but I am not allowed to do
> so), so
> I have to come up with sth else that does the same as the in built
> The only thing that sample() does is rearranging the items of a sample,
> so I
> searched the internet for a function that does that to be able to use
> but I cannot find anything that could help me.
> Can maybe someone help me with this?
> I would be very grateful,
> View this message in context: http://r.789695.n4.nabble.com/rearrange-
> 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-
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help