[R] sample() from (un-)sorted vectors

saschaview at gmail.com
2012-08-15T16:11:15Z

Hello,

Vector y is an alphabetically sorted version of vector x. Will both
samples, X and Y, be "absolutely" random or will they have systematic
differences? And: Should I sort or shuffle a vector before sampling?

Thank you, *S*

x <- as.factor(LETTERS[sequence(10:1)])
y <- sort(x)
X <- sample(x, 5)
Y <- sample(y, 5)


--
Sascha Vieweg, saschaview at gmail.com