【发布时间】:2018-02-14 12:46:06
【问题描述】:
我有两个数据框。
> dput(df1)
structure(list(Station = structure(1:9, .Label = c("A", "B",
"C", "D", "E", "F", "G", "H", "I"), class = "factor"), Dwelling_Probability = c(0.948,
0.65, 0.592, 0.558, 0.527, 0.514, 0.494, 0.492, 0.435)), .Names = c("Station",
"Dwelling_Probability"), class = "data.frame", row.names = c(NA,
-9L))
> dput(df2)
structure(list(Station = structure(c(6L, 8L, 2L, 4L, 3L, 5L,
9L, 1L, 7L), .Label = c("A", "B", "C", "D", "E", "F", "G", "H",
"I"), class = "factor"), Access_Time = c(31L, 23L, 21L, 16L,
11L, 7L, 6L, 5L, 2L)), .Names = c("Station", "Access_Time"), class = "data.frame", row.names = c(NA,
-9L))
以下示例显示了将居住概率和访问次数排名结合起来的应用程序。 居住概率排名(左)和访问时间排名(右)汇总为一个(中)。我正在尝试获得排名中间的数据框
是否有一个排名聚合包可以做到这一点。
【问题讨论】:
-
站 F (0.514 * 31 = 15.934) 不应该排在 B (0.65 * 21 = 13.65) 之上吗?
-
我也有同样的问题。你有没有想过解决方案?
标签: r aggregation rank