Menu

We can use str_replace()  or str_replace_all()  to replace unwanted symbols depending on the situation.

str_replace

str_replace()  will only work on the first encounter with the symbols. To get rid of all symbols regardless of the number of an encounter, we need str_replace_all() .

str_replace_all

Let’s recreate the data frame again.

Then we will use str_replace_all() .