I have a very large sparse matrix of size
150000x2500
and in this matrix I have some cells whose values are NA. So I want to assign 0 to those NA cells. Currently I am doing
x[is.na(x)] <- 0
where x is the matrix. But this approach is taking a huge time. Is there any better way to do it.