[R] How can I create a vector of vector?

Henrique Dallazuanna wwwhsd at gmail.com
Fri Aug 8 21:23:00 CEST 2008


You can create a list of vector.

x <- list(c(31,2,3),
          c(1,2,5,34,5656),
          c(211,3243,5,343,3))

x[[1]]
x[[2]]
x[[3]]

On Fri, Aug 8, 2008 at 2:59 PM, Jim <chunchiliu at gmail.com> wrote:
> Dear All,
>
> How can I create a vector of vector in R?
> for example, I would input the data as follows:
> x[1] <- c(31,2,3)
> x[2] <- c(1,2,5,34,5656)
> x[3] <- c(211,3243,5,343,3)
>
> Jim Liu
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



More information about the R-help mailing list