Syntax error How to remove unique characters within strings in R?

How to remove unique characters within strings in R?



We can achieve this by using gsub function

Example

> x <- c("14870e", "16578e", "302e47", "e95748")
> x
[1] "14870e" "16578e" "302e47" "e95748"
> gsub("e", "", x)
[1] "14870" "16578" "30247" "95748"
Updated on: 2020-07-06T14:33:32+05:30

173 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements