I'm new to R. I am trying to select all rows from a dataset where column x = y. Where y is an integer.
My code:
data_sub <- data_full[data_full$x == y,]
I am encountering a strange problem where the argument is returning the rows I asked for plus all rows in data_full
where x = NA
.
Has anyone encountered this before / could you explain it to me?