I'm organizing some gatherings, and I've been storing the names and phone extensions in an R dataframe.
names <- c("Adrian Xavier", "Berta Xavier",
"Charles Yamazaki", "Daniela Yamazaki",
"Edward Zachary", "Fiona Zachary")
phonex <- c(4739, 3894,
7238, 7459,
7573, 9457)
people <- data.frame("Name"=names, "PhoneX"=phonex)
To invite the Yamazakis only, I prepare the list by
only_y <- people[grep("Yamazaki", people$"Name"), ]
and to prepare a list that excludes the same set, I run:
exclude_y <- people[grep("Yamazaki", people$"Name", invert=TRUE), ]
How do I prepare a list that excludes both the Xaviers and the Yamazakis, but that includes everyone else?
Related questions: