Вот вариант использования пакета stringr
в R.
library(stringr)
TargetPrefixes <- c("Faculty", "Department", "Univrsity", "College", "Institute")
split <- str_split(data$Affiliation,",")
split <- unlist(split)
trim <- str_trim(split,side = "both")
matches <- sapply(trim,function(x){Reduce(`|`,(str_detect(x,TargetPrefixes)))})
result <- unique(trim[matches])
result
[1] "Faculty of X1" "Department of Y1" "Institute of W1" "College of X2" "Department of Y2" "Institute of W2" "College of X3"
Данные
data <- structure(list(Name = c("Anna", "Isabela", "Wally"), Affiliation = c("Faculty of X1, Department of Y1, Z1 University, City A, Country 1",
"Institute of W1, College of X2, Department of Y2, University of Z2, Country 1",
"Institute of W2, College of X3, Department of Y2, University of Z2, Country 1"
)), class = "data.frame", row.names = c(NA, -3L))