我有一个数据框(df),如下所示:
M4, 2007-05-03T09:00:00Z,1021.2,50,12, NaN,12.2,84
M4, 2007-05-03T10:00:00Z,1021.6,50,10, NaN,12.3,84
M4, 2007-05-03T11:00:00Z,1020.8,50,9, NaN,12.4,84
M4, 2007-05-03T12:00:00Z,1021.8,50,9, NaN,12.3, NaN
M4, 2007-05-03T13:00:00Z,1021.8,40,10, NaN,12.3,86
M4, 2007-05-03T14:00:00Z,1021.6,40,11, NaN,12,89
M4, 2007-05-03T15:00:00Z,1021.6,40,12,18,10.1,92
M4, 2007-05-03T16:00:00Z,1021.2,40,10,16,10,94
M4, 2007-05-03T17:00:00Z,1021,30,11,16,10.2,94
我不明白,为什么下面的陈述没有任何效果。观察的数量仍然相同,并且在#34;清理过的"数据集,NaN值仍然出现。
df.clean <- df[complete.cases(df), ]
感谢您的提示。