Hi:
Your R terminology needs a little work, but I think this is what you're after:
# read your example data from e-mail into an R session
dd <- read.table(textConnection("
Ind1 11 00 12 15 28
Ind2 21 33 22 67 52
Ind3 22 45 21 22 56
Ind4 11 25 74 77 42
Ind5 41 32 67 45 22"), header
Sorry, that second line of code won't work: do it in 2.
f <- function() {return(sample(1:5,3,replace=T/F))}
replicate(100,f())
Michael
On Wed, Aug 10, 2011 at 3:06 PM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> To pick random elements to sample, you can just use the sample func
To pick random elements to sample, you can just use the sample function
sample(1:5,3,replace=T/F) # pick true or false as needed for your data.
If you replicate this, you should have no problem.
replicate(100,function() return(sample(1:5,3,replace=T/F)))
This will be plenty fast, but if you get
Hello,
I am a R beginner and hoping to obtain some hints or suggestions about
using permutations to sort a data set I have.
Here is an example dataset:
Ind1 11 00 12 15 28
Ind2 21 33 22 67 52
Ind3 22 45 21 22 56
Ind4 11 25 74 77 42
Ind5 41 32 67 45 22
This will
4 matches
Mail list logo