strsplit
returs a list
. Each element of the list
contains the divided string. You can change the list
into a matrix
with do.call
and rbind
and then select the second column,
GetRank <- function(x) {as.numeric(do.call(rbind, strsplit(x, split=":"))[, 2]) }
GetRank(HiRawTiny$V1)