I\'m trying to figure out an efficient way to go about splitting a string like
\"111110000011110000111000\"
into a vector
[1] \
Another approach in case, using mapply:
mapply
x="111110000011110000111000" with(rle(strsplit(x,'')[[1]]), mapply(function(u,v) paste0(rep(v,u), collapse=''), lengths, values)) #[1] "11111" "00000" "1111" "0000" "111" "000"