2
I would like to replace NA
by the content of another column. I have the following data:
NOME TIPO VALOR
ABC INTERNACAO 10
ADD 20
AFF CONSULTA 30
DDD EXAME 40
RTF 50
DRGG EXAME 60
How would you replace the NA
by the content of the next column? Example: O NA
of the line ADD
(spine TIPO
), would be replaced by number 20. And on the line RTF
(spine TIPO
) would be replaced by 50. Grateful
the example you used is empty. How would you do if the data were in NA?
– Bruno Avila
replace the line with the command
which
forpos <- which(is.na(dados$TIPO))
– Rafael Cunha