From a character vector of strings
x <- c("Point to Point Movement, Route/Network Building",
"Betting/Wagering, Dice Rolling, Roll / Spin and Move",
"Hand Management, Take That")
extract a word if it is contained in
p <- c("Route","Dice")
otherwise NA
. The resulting output would be "Route" from x[1]
, "Dice" from x[2]
, and NA
from x[3]
.