Is there an R type equivalent to a Matlab structure type?
I have several named vectors, and I'm trying to save them in a data frame. Ideally, I would simply access one element of the object and return the named vectors (for example, the structure in Matlab). I believe that using a data frame is wrong, because it can store the values โโof named vectors, but not names, when they differ from one vector to another.
More generally, is it possible to store a bunch of different objects in one in R?
Change . As Joran said, I think that listdoes the job.
l = list()
l$vec1 = namedVector1
l$vec2 = namedVector2
...
If I have a list of names
name1 = 'vec1'
name2 = 'vec2'
, , , 1, , ? get(name1), .