2012-07-09 60 views

回答

4

ifelse函數完全符合你的要求。如果您的數據框被稱爲d,列名爲d$column

d$column = ifelse(d$column < X, 0, 1) 
相關問題