how to remove string before in column name in r code example
Example: 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"