- for a specific variable:
x[!is.na(x)] or na.omit (see apropos("^na\\.") for all available na. functions na. ), - in a function, pass
na.rm = TRUE as an argument, for example. sapply(dtf, sd, na.rm = TRUE) , - set the global action NA:
options(na.action = "na.omit") which is installed by default, but many functions do not rely on the global specific action NA ( mean for instance), while some do (right now I cannot come up with an example) - and of course, if you have a lot of NA, you should consider the variable imputation, there the question asked on SO can be useful.
In short, working with NA is a very wide problem, try to specify it a bit and give us a brief question. I'm sure someone from SOers can help you!
Hi boy!
source share