[R] vector of Vectors
Schalk Heunis
schalk.heunis at enerweb.co.za
Wed Sep 9 07:30:23 CEST 2009
You want to use list:
a = list()
a[[1]] = c(1,2,3)
a[[2]] = c(1,2,3)
Note the [[..]] operator - check the "An Introduction to R" manual for
more details
Schalk Heunis
On Wed, Sep 9, 2009 at 6:00 AM, <sclarke3 at illinois.edu> wrote:
> I just learned that vectors can't contain vectors, which frankly simply confuses me (can you imagine arrays or lists in any other language not being able to contain arrays or lists?). At any rate, I need to create a data structure (size to be determined at runtime) which I will instantiate and then fill with vectors using a for loop. Clearly I'm new to the R game. Data Frame doesnt seem to be the right tool clearly.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list