I have the following data frame
df <- data.frame(A1 = c("A","A","A","A","A","A","A","A","A","A","B","B","B","B","B","B","B","B","B","B"),
B2 = c("C","D","C","D","C","D","C","D","C","D","C","D","C","D","C","D","C","D","C","D"),
C3 = c("E","F","E","F","E","F","E","F","E","F","E","F","E","F","E","F","E","F","E","F"),
D4=c(1,12,5,41,45,4,5,6,12,7,3,4,6,8,12,4,12,1,6,7))
and I would like to subset all the rows for which the first 3 column match the vector c("A","C","E")
I have tried to use which but it does not work
vct <- c("A","C","E")
df[which(df[1:3] == vct)]
?%in%.