Skip to content
Prev 381251 / 398502 Next

can not extract rows which match a string

Hello,

You have to use is.na to get the NA values.


t1 <- data.frame(sex_chromosome_aneuploidy_f22019_0_0 = c(NA, "Yes"),
                  other = 1:2)

i <- t1$sex_chromosome_aneuploidy_f22019_0_0 == "Yes" & 
!is.na(t1$sex_chromosome_aneuploidy_f22019_0_0)
i
t1[i, ]


Hope this helps,

Rui Barradas

?s 19:58 de 03/10/19, Ana Marija escreveu: