r - Creating a multiple data frames in FOR-LOOP -


this question has answer here:

i create data frames for-loop in r.

basically, this:

for (i in 1:3) { x"i"= 1+i} 

in case, 3 dataframes:

  • x1 contain 2
  • x2 contain 3
  • x3 contain 4

is there way in r?

for (i in 1:3) {   assign(paste0("x", i), + 1) } 

this create objects x1, x2, , x3 values of i + 1, i.e., 2-4.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -