I use a
str_detect() to filter a column for words that are part of a certain column that I uploaded through excel.
I want to exclude strings in the column
trigram that contain the whole word hub (with a space before and after, of on the beginning or end of the string). Therefore, I entered hub\s in the excel sheet. This returns as
"hub\\\\s" in R. What is the right thing to do here?
hf_trigram_excl_ad <- hf_trigrams_sorted %>% filter(!str_detect(trigram, paste(hf_bus_kw$excl_ad_gr, collapse = "|")))` hf_bus_kw$excl_ad_gr  "hub\\\\s"