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: 06-Jul-2020

113 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements