To your first question, one of the reasons that comes to mind is that it can store result vectors of different lengths in the same object, since it is vectorized over x :
text <- "who let the dogs out" vtext <- c(text, "who let the") ## > strsplit(text, " ") [[1]] [1] "who" "let" "the" "dogs" "out" > strsplit(vtext, " ") [[1]] [1] "who" "let" "the" "dogs" "out" [[2]] [1] "who" "let" "the"
If it were to be returned as data.frame , matrix , etc. instead of list , it should be supplemented with additional elements.
source share