我想基于另一列中的4个值创建一个新列.
if col1=1 then col2= G; if col1=2 then col2=H; if col1=3 then col2=J; if col1=4 then col2=K.
我怎么做R?我需要有人帮忙解决这个问题.我试过if/else和ifelse,但似乎没有工作.谢谢
if-statement r
if-statement ×1
r ×1