r - Creating a multiple data frames in FOR-LOOP -
this question has answer here:
- how name variables on fly? 5 answers
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
Post a Comment