Given this df:
A B C
1 a 1 53
2 a 0 27
3 a 1 46
4 b 1 42
5 c 0 97
6 d 1 46
7 d 0 24
And the values defined to match for deleting are in a vector:
values_delete <- c("b", "c")
How can I delete the rows in df using a conditional with the vector? I tried:
df2 <- df[df$A != values_delete,]
But it doesn't allow it. This is the error:
longer object length is not a multiple of shorter object lengthlonger object length is not a multiple of shorter object length
df[!df$A %in% values_delete, ]?