我正在尝试将数据框作为列表放在R中的一个单元格中,但是当我尝试执行此操作时,我会收到一条警告消息,并且仅保存在第一列中
library(tidyverse)
list1 <- list(A = "A1", B = "B1", C = "C1") # Create first example list
list1
list2 <- list(A = "A2", B = "B2", C = "C2") # Create second example list
list2
list12 <- Map(c, list1, list2) %>% as.data.frame() # Merge two lists
list12
Test_ <- "Row1" %>% as.data.frame()
Test_$list[1] <- list12
这是错误
Warning message:
In Test_$list[1] <- list12 :
number of items to replace is not a multiple of replacement length
我们可以用包裹list
在list12
一个data.frame
Test_$list[1] <- list(list12)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句