0

我有一个长度为 0f 173 的列表,其中每个元素有 48 个项目。我想从中制作一个数据框,最终有 48 行和 173 列。项目的名称无关紧要并且不匹配,所以我该怎么做?

dput(tra[[1]][1:5,1:5])
structure(list(c..0.0....93.. = structure(c(1L, NA, NA, NA, NA
), .Label = c("0|0", "93"), class = "factor"), c..0.0....127.. = structure(c(1L, 
NA, NA, NA, NA), .Label = c("0|0", "127"), class = "factor"), 
    c..0.0....127...1 = structure(c(1L, NA, NA, NA, NA), .Label = c("0|0", 
    "127"), class = "factor"), c..0.0....127...2 = structure(c(1L, 
    NA, NA, NA, NA), .Label = c("0|0", "127"), class = "factor"), 
    c..0.0....127...3 = structure(c(1L, NA, NA, NA, NA), .Label = c("0|0", 
    "127"), class = "factor")), .Names = c("c..0.0....93..", 
"c..0.0....127..", "c..0.0....127...1", "c..0.0....127...2", 
"c..0.0....127...3"), row.names = c("1", "NA", "NA.1", "NA.2", 
"NA.3"), class = "data.frame")

我试过了:

> ft <- data.frame(matrix(unlist(tra), nrow=173, byrow=T))
Error in matrix(unlist(tra), nrow = 173, byrow = T) : 
'data' must be of a vector type, was 'NULL'
AND 
> traa <- do.call(rbind.data.frame, tra)
Error in match.names(clabs, names(xi)) : 
names do not match previous names
4

0 回答 0