Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Betawolf/6bad72fb30ad3da70e9320cfac33ffe1 to your computer and use it in GitHub Desktop.
Save Betawolf/6bad72fb30ad3da70e9320cfac33ffe1 to your computer and use it in GitHub Desktop.
Updated helper function
# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment