我是R语言的新手,我有一个在R中的列表t1
,看起来像这样:
[[1]]
[[1]][[1]]
[1] "a" "control"
[[2]]
[[2]][[1]]
[1] "a" "disease1"
[[3]]
[[3]][[1]]
[1] "a" "disease2"
[[4]]
[[4]][[1]]
[1] "b" "control"
[[5]]
[[5]][[1]]
[1] "b" "disease1"
[[6]]
[[6]][[1]]
[1] "b" "disease2"
我需要从向量t1
中获取第一个元素的唯一列表,即 ["a", "b"]。我该如何做到这一点?
dput
。 - Paul Hiemstra