Skip to content
Prev 170157 / 398506 Next

What is going on?

The problem is that strsplit is designed to work on a *vector* of
characters (your example is a length-1 vector of characters), each
of which might end up being split into a character vector of different
lengths, so it returns its results as a *list* the same length as
the original character vector: in this case a list of length 1.
List of 1
 $ : chr [1:2] "1" "2"

length(l) is 1; length(l[[1]]) is 2.

  Ben Bolker
Paul Johnston-6 wrote: