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.
次の変数があります。
i="QW"
i を使用して次の vectore を定義したいと思います。
> c(QW=3) QW 3
しかし、私が使用するとき
> c(i=3) i 3
ご覧のとおり、機能しません。では、文字「i」を使用して列に名前を付ける代わりに、iの値を使用するように c() に指示するにはどうすればよいでしょうか。
使用できますsetNames:
setNames
setNames(3, i) # QW # 3