Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
R で FOR-LOOP からデータ フレームを作成したいと思います。
基本的に、私はこのようなことをしたいと思います:
for (i in 1:3) { x"i"= 1+i}
この場合、3 つのデータフレームを取得したいと思います。
Rでこれを行う方法はありますか?
for (i in 1:3) { assign(paste0("x", i), i + 1) }
これにより、オブジェクトx1、x2、およびx3が値i + 1、つまり 2 ~ 4 で作成されます。
x1
x2
x3
i + 1