I have some data that looks like this:
dat <- c("Sales","Jim","Halpert","","",
"Reception","Pam","Beasley","","",
"Not.Manager","Dwight","Schrute","Bears","Beets","BattlestarGalactica","","",
"Manager","Michael","Scott","","")
Each "chunk" of data is consecutive with some blanks in between. I want to transform the data into a list of lists that looks like this:
iwant <- c(
c("Sales","Jim","Halpert"),
c("Reception","Pam","Beasley"),
c("Not.Manager","Dwight","Schrute","Bears","Beets","BattlestarGalactica"),
c("Manager","Michael","Scott")
)
Suggestions? I am using rvest and stringi. I do not want to add more packages.
dat
andiwant
are one single vector.