Partial animal string matching in R
I have a dataframe, d<-data.frame(name=c("brown cat", "blue cat", "big lion", "tall tiger", "black panther", "short cat", "red bird", "short bird stuffed", "big eagle", "bad sparrow", "dog fish", "head dog", "brown yorkie", "lab short bulldog"), label=1:14) I'd like to search the name column and if the words "cat", "lion", "tiger", and "panther" appear, I want to assign the character string feline to a new column and corresponding row species . If the words "bird", "eagle", and "sparrow" appear, I want to assign the character string avian to a new column and corresponding row species . If the