R:创建列表

来源:互联网 发布:js正则表达式\s 编辑:程序博客网 时间:2024/06/05 00:37


> g <- "My First List."
> h <- c(23,45,67,54)
> j <- matrix(1:10, nrow=5)
> k <- c("one ", "two", "three")
> mylist <- list(title=g, ages=h, j, k)
> mylist
$title
[1] "My First List."


$ages
[1] 23 45 67 54


[[3]]
     [,1] [,2]
[1,]    1    6
[2,]    2    7
[3,]    3    8
[4,]    4    9
[5,]    5   10


[[4]]
[1] "one "  "two"   "three"



原创粉丝点击