Answers for "remove everything before the first match in r"

R
0

r remove all string before : in r data frame

> x <- 'aabb.ccdd'
> sub('.*', '', x)
[1] ""
> sub('bb.*', '', x)
[1] "aa"
> sub('.*bb', '', x)
[1] ".ccdd"
> sub('\..*', '', x)
[1] "aabb"
> sub('.*\.', '', x)
[1] "ccdd"
Posted by: Guest on May-30-2020
0

r substitute string characters until first :

sub(".*? ", "", D$name)
Posted by: Guest on May-30-2020

Code answers related to "remove everything before the first match in r"

Browse Popular Code Answers by Language