Sukrit Parinyanusorn
Sukrit Parinyanusorn

Reputation: 21

Is it possible that we can remove comma from character variable by R command?

I have a table column names and variables contain comma eg. "Stark, Tony". How could I remove comma from all row by using R command?

Upvotes: 0

Views: 720

Answers (1)

Ben Bolker
Ben Bolker

Reputation: 226247

stringr::str_remove("Stark, Tony", ",")
## [1] "Stark Tony"

or in base R

gsub(",", "", "Stark, Tony")

Upvotes: 3

Related Questions