5
Currently I have a data frame with textual and numerical variables. However, some variables have NA
in just a few observations, not all. For example, I have the following data frame
Cidade Estado populacao idh area
Salvador BA 21212 3 NA
Salvador BA 21212 NA 23323
Salvador BA 21212 3 23323
Salvador BA 21212 3 23323
Salvador BA 21212 NA 23323
In case I needed to eliminate variables once and for all IDH
and AREA
. But in my example I have more than 2,000 variables, so you can’t analyze them one by one. How to solve this? Note that I want to exclude the variable (column), not the observation (line).
Just to be clear: the goal is to eliminate any column that has at least one observation equal to
NA
?– Marcus Nunes