Skip to content
Prev 312248 / 398506 Next

remove NA or 0 values

Hello,

You should keep this in the list, the odds of getting more and better 
answers are bigger.
As for your dataset, it doesn't have the same structure as your previous 
example. If you want a list with all zeros and NAs removed you can try 
(assuming it's named 'dat')

lapply(dat, function(x) x[x != 0 & !is.na(x)])

Hope this helps,

Rui Barradas
Em 28-11-2012 15:12, catalin roibu escreveu: