I want to randomly split a data table into n number of outputs; then I want to write.table those outputs for each list. So, in test I want to write a file for each list within test.
library(data.table)
set.seed(100)
dt <- data.table(x=rnorm(1000))
n <- 10 # number of data sets
# randomly splits dt into n number of outputs
test <- split(dt, sample(1:n, nrow(dt), replace=T))
# writing tables for each sublist within test
# write.table(test)
# names <- paste0("output", n, ".txt", sep="")