Here's a suggestion.
The sample() function takes random samples of sets. See
?sample
The set you want to take a random sample from is the rows of your data.
Represent the rows by their row numbers.
To get a vector of row numbers, you can use the seq() function. See
?seq
Let's suppose your dat
1. You need to define more explicitly exactly what you mean by "randomly."
2. You need to make an honest effort to learn basic R, e.g. by
spending time with the "Introduction to R" document that ships with R
or an online tutorial (there are many good ones).
Cheers,
Bert
On Sun, Nov 10, 2013 at 1
2 matches
Mail list logo