I am trying to create a vector indicating whether country names in a data frame match any value from a separate list.
The separate list of country names looks like t
How about
transform(df,match=as.numeric(country %in% list))
?
(I can't help pointing out that the %in% operator is covered on the R help page for the "match" function ...)
%in%