Displaying 1 result from an estimated 1 matches for "allsamples".
2011 Sep 03
1
Loop with random sampling and write.table
Hi!
I need to perform this simple sampling function several hundred times:
x1=as.character(rnorm(1000, 100, 15))
x2=as.character(rnorm(1000, 150, 10))
y1=as.data.frame(x1,x2)
sample1=as.data.frame(sample(y1$x1, 12, replace = FALSE, prob = NULL))
sample1
write.table(sample1, "sample1.txt", sep=" ",row.names=F,quote=F)
My knowledge of loops is quite low. How can I produce 100