【发布时间】:2017-05-21 16:54:40
【问题描述】:
我正在尝试从当前数据结构中找到想要的数据结构。
我部分知道预期数据结构的示意图。
想要的数据结构还包括一个list(...) 和factor 类。
当前数据结构
> print(dat.m)
[,1] [,2]
ave_max 150 61
ave 60 0
lepo 41 0
dat.m <- structure(c(150L, 60L, 41L, 61L, 0L, 0L), .Dim = c(3L, 2L), .Dimnames = list(
c("ave_max", "ave", "lepo"), NULL))
想要的数据结构
> print(dat.m)
Vars M1 M2
1 ave_max 150 61
2 ave 60 0
3 lepo 41 0
我知道它示意性地类似于以下未知的structure(c(...) 和row.names = c(...)
structure(list(Vars = structure(c(...), .Label = c("ave_max",
"ave", "lepo"), class = "factor"), M1 = c(150, 60,
41), M2 = c(61, 0, 0)), .Names = c("Vars", "ave_max", "ave",
"lepo"), class = "data.frame", row.names = c(...))
R:3.4.0(向后移植)
操作系统:Debian 8.7
【问题讨论】:
标签: r data-structures