vendredi 24 août 2018

ifelse() gave me wrong output

I got a data.frame named DF1

Digit Country 1 A 1 B 2 C 6 D 7 E

i'm using DF1$Digit <- ifelse(DF1$Digit<=5,"",DF1$Digit) it become Digit Country A B C 6 D 7 E after that i uses DF1$Country2 <- ifelse(DF1$Digit== "","",DF1$Country) For some reason the output is

Digit Country Country2 A
B
C
16 China P Rep 36
15 Indonesia 80

I doesn't know what's the problem here.. Hope someone could help me

Aucun commentaire:

Enregistrer un commentaire