Occasionally, I've written buggy R code that produced an object that printed like a matrix, but where the elements were vectors. It might look something like this:
[,1] [,2] [,3] [1,] character,2 character,2 character,2 [2,] character,2 character,2 character,2 [3,] character,2 character,2 character,2 I've never intended to create one before, but now I'm working on a project where this data structure could be useful.
What is it? How do I make one? What are its properties? For iterating over rows and columns, how does its efficiency compare to a nested list, an array, or a list of matrices?
matrix(list(c("a", "b")))for example.Dimattribute? That's my impression based ondput(matrix(list(c("a", "b")))). This is really cool and I wonder why nobody does it. At any rate you should post that as an answer.