一旦列表开始变得有点嵌套,我就会更加努力地与它们斗争(我认为其他人也可能会为嵌套列表而斗争)。我有一个列表,我想以某种格式放在一起。这是列表的示例:
ms2 <- list(list(" question", c(" thin", " thick"), " one", c(" simple",
" big")), list(" infer", " theme", c(" strategy", " guess", " inform"
), c(" big", " idea", " feel", " one")), list(
"synthesi", c(" predict", " thin", " thick", " parts", " visual",
" determin", " schema", " connect", " background", " knowledge",
" strategy", " infer", " question", " importance"), NA_character_,
c(" things", " picture")), list(" visual", " strategy", " picture",
NA_character_), list(" question", " wonder", c(" them", " one"
), NA_character_), list(" predict", NA_character_, c(" think",
" guess", " wonder"), NA_character_))
我想将前三个和后三个列表组合在一起,得到 2 个包含 4 个向量的列表,如下所示(这仅适用于第一个列表)。
list(c("question", "infer", "synthesi", "visual"),
c("thin", "thick", "theme", "predict", "parts",
"visual", "determin", "schema", "connect", "backgraound",
"knowledge", "strategy", "infer", "question", "importance",
"strategy"),
c("one", "strategy", "guess", "inform", "picture"),
c("simple", "big", "idea", "feel", "one", "things", "picture"))