On 8/8/2008 1:59 PM, Jim 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)

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

Note the double brackets: x[[1]] is the thing stored in the first element of x; x[1] would be a length-1 list containing only the first element from the list x.

Duncan Murdoch

______________________________________________
R-help@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.

Reply via email to