Hi Pete Pete,
Try
# option 1 -- 100 files
sapply(1:100, function(i){
x <-sample(rnorm(1000, 100, 15), 12, replace = FALSE)
write.table(x, paste("sample", i, ".txt", sep = ""), row.names = FALSE,
quote = FALSE))
})
# option 2 -- all the information in one file
d <- replicate(100, sample(rnorm(1
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="
2 matches
Mail list logo