我想尝试两件事情:删除NA/NaN的/ INF在矩阵
- 我如何删除包含NA/NaN的/ INF
- 行如何设置数据点的值从NA/NaN/Inf为0.
到目前为止,我已经尝试使用以下NA值,但一直在收到警告。
> 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',这也是'utils'包中的一个函数。也就是说,你在函数上调用'is.na',这是没有意义的。 –
分享到:相关文章:https://stackoverflow.com/questions/7518245/one-function-to-detect-nan-na-inf-inf-etc – zx8754