Is there a way to remove or replace with ""
, the "X"
from the beginning of words?
Ex:
XN5634_er
X123_er
NX45
Desired output:
N5634_er
123_er
NX45
Totally I have about 14.000 words. I used
gsub("X", '', mylist, fixed = T)
but X
is removed from NX45
too.
Try:
> mylist <- list("XN5634_er", "X123_er", "NX45")
> gsub("^X", '', mylist)
[1] "N5634_er" "123_er" "NX45"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With