0

Suppose I want to dynamically create data tables in a loop, for example:

for(i in 1:3){

  paste0('a',i)= data.table(x=1)


}

This returns an error. What is the syntax to do this properly?

wolfsatthedoor
  • 6,697
  • 16
  • 43
  • 85
  • Do you want to store these `data.table`s in a list? Try `n – markus Jan 09 '19 at 21:02
  • 3
    Well, the "correct" way is not to do this at all. Generally it's much better to work with variables in a list rather than creating a bunch of related variables with indexes embedded in their name. – MrFlick Jan 09 '19 at 21:06

0 Answers0