New column based on string pattern

Find a string pattern in a column. Create a new column

df$new_column[df$colum_with_pattern %in% c("abc", "def")] <- "string in new column"

# alternative with pattern vector
patterns <- c("abc", "def")

df$new_column[df$colum_with_pattern %in% patterns] <- "string in new column"