-3

So I have data imported to r using data=read.delim("clipboard")

This is the last sections of the data....so I decided to use data2=na.omit(data,method="linear") which gave me this result...

But as you can see I have lost data from 290 to 293 ....for the 3rd and 4th column....pls help remove those NA values without losing data from the other columns...The data I have given you represents time and speed data...and what I'm trying to do is find the average speed every 100s etc...using a code pointed out to me earlier in my previous questions which is in this link...h

4

1 回答 1

3

保持 na 值不变,但在后续操作中使用 na.rm ;例如,sum(df[,1], na.rm = TRUE)其中 df 是您的数据框。

于 2013-02-24T11:14:01.067 回答