Reputation: 2927
If I have the following column in a data frame:
df$column <- c("store", "the store", "factory", "factory A")
I want to search for an occurrence of 'store'
in df$column
if we find a row that contains 'store'
then replace it with 'store'
. So if we come across 'the store'
it should be replaced with 'store'
because 'store'
is contained in this instance.
So a resulting output would be:
"store", "store", "factory", "factory A"
Upvotes: 0
Views: 345