Select rows from a data frame based on values in a vector
问题 I have data similar to this: dt <- structure(list(fct = structure(c(1L, 2L, 3L, 4L, 3L, 4L, 1L, 2L, 3L, 1L, 2L, 3L, 2L, 3L, 4L), .Label = c(\"a\", \"b\", \"c\", \"d\"), class = \"factor\"), X = c(2L, 4L, 3L, 2L, 5L, 4L, 7L, 2L, 9L, 1L, 4L, 2L, 5L, 4L, 2L)), .Names = c(\"fct\", \"X\"), class = \"data.frame\", row.names = c(NA, -15L)) I want to select rows from this data frame based on the values in the fct variable. For example, if I wish to select rows containing either \"a\" or \"c\" I can