On 08/15/2013 04:16 PM, Pooya Lalehzari wrote:
Hello everyone, How can I create a data_table with 1000 variables (Var1:Var1000)?
I'm not familiar with data_table, but here's an example to get you started in figuring this out:
> n <- 3 > var.range <- 1:n > prefix <- "Var" > data <- as.data.frame(as.list(var.range)) > names(data) <- paste(prefix, var.range, sep="") > data Var1 Var2 Var3 1 1 2 3 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.