I want to try two things :
- How do I remove rows that contain NA/NaN/Inf
- How do I set value of data point from NA/NaN/Inf to 0.
So far, I have tried using the following for NA values, but been getting warnings.
> eg <- data[rowSums(is.na(data)) == 0,]
Error in rowSums(is.na(data)) : 'x' must be an array of at least two dimensions In addition: Warning message: In is.na(data) : is.na() applied to non-(list or vector) of type 'closure'
data
, which is also a function in theutils
package. I.e., you were callingis.na
on a function, which doesn't make sense. – Hallette