This was partially already tackled in others posts but unfortunately I could not make it run properly on my side.
I have a data frame full of texts, and there are certain
You can create a named list and use it to replace values in str_replace_all
:
hous$HouseType <- stringr::str_replace_all(hous$HouseType,
setNames(maps$UniqueID, maps$Names))
hous
# HouseType HouseTypeNo
#1 Fruit Fruit Fruit Honey Onion Garlic Pepper Sugar
#2 Animals Animals Animals Mushrooms Soya Eggs