热线电话:13121318867

登录
2019-01-12 阅读量: 695
创建一个列表的示例

> g <- "My First List"

> h <- c(25, 26, 18, 39)

> 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] 25 26 18 39[[3]][,1] [,2][1,] 1 6[2,] 2 7[3,] 3 8[4,] 4 9[5,] 5 10[[4]][1] "one" "two" "three"

> mylist[[2]]

[1] 25 26 18 39

> mylist[["ages"]]

[[1] 25 26 18 39

0.0000
1
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子