Expand strsplit to data.frame

June 11, 2015 in #r

Take a vector, with some seperator (i.e., ;), vec and expand it into a data.frame, filling in NA positions:

vec <- strsplit(as.character(vec), ";")  
df <- rbind.fill(  
  lapply(
    tmp, function(x) data.frame(t(x))
  )
)
df <- as.data.frame(df)