【发布时间】:2018-06-26 15:10:22
【问题描述】:
我有这个数据框
# of int. int. not.int. ID group odd even
2 24 85.15 113.34 2 thc1 NA 486.66
3 33 134.94 158.17 3 thc2 465.06 NA
4 12 47.60 62.73 4 thc3 NA 537.27
1 50 218.41 372.16 1 veh 381.59 NA
5 44 176.81 268.92 5 veh NA 331.08
如何替换 'int.' 中的数字。 '偶数'中的数字不添加 NA's 和'奇数'和'not.int'相同?所以它看起来像这样。
# of int. int. not.int. ID group odd even
2 24 486.66 113.34 2 thc1 NA 486.66
3 33 134.94 465.06 3 thc2 465.06 NA
4 12 537.27 62.73 4 thc3 NA 537.27
1 50 218.41 381.59 1 veh 381.59 NA
5 44 331.08 268.92 5 veh NA 331.08
【问题讨论】: