我有一个包含许多数据框的列表(下面提供的示例)。
G100=structure(list(Return.Period = structure(c(4L, 6L, 2L, 3L, 5L,
1L), .Label = c("100yrs", "10yrs", "20yrs", "2yrs", "50yrs",
"5yrs"), class = "factor"), X95..lower.CI = c(54.3488053692529,
73.33363378538, 84.0868168935697, 91.6191228597281, 96.3360349026068,
95.4278817251266), Estimate = c(61.6857930414643, 84.8210149260708,
101.483909733627, 118.735593472652, 143.33257990536, 163.806035490329
), X95..upper.CI = c(69.0227807136758, 96.3083960667617, 118.881002573685,
145.852064085577, 190.329124908114, 232.18418925553)), .Names = c("Return.Period",
"X95..lower.CI", "Estimate", "X95..upper.CI"), row.names = c(NA,
-6L), class = "data.frame")
G101<-G100 # just for illustration
mylist=list(G100,G101) # there 100 of these with differet codes
names(mylist) 代表“站点”。从每个数据帧中,我想采用“估计”并形成一个看起来像这样的新数据帧(不准确,因为所有 dfs 的值都不相同):估计<-
SITE X2yrs X5yrs X10yrs X20yrs X50yrs X100yrs
G100 61.68579 84.82101 101.4839 118.7356 143.3326 163.806
G101 61.68579 84.82101 101.4839 118.7356 143.3326 163.806
请注意,这SITE
与mylist
.
"X95..lower.CI"
对和做同样的事情"X95..upper.CI"
。
所以,我最终会得到 3 个 dataframes和"Estimate"
上面的布局。"X95..lower.CI"
"X95..upper.CI".
#lapply, rbindlist,cbind and others can do but how?
请提出建议。