remove letters in columns in R code example
Example 1: r remove row names
rownames(data) <- c()
Example 2: 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"