Skip to content

Instantly share code, notes, and snippets.

# original vector
vctseq <- c('1:4', '1:6', '1,5', '1,3,5', '2, 4:8, 10')
# helper function to parse text
# can be done within lapply, as well
fctParse <- function(x){eval(parse(text = paste0('c(',x,')')))}
# create list of number strings
lstseq <- lapply(vctseq, fctParse)