我有两个数据框
prop=structure(list(KOD_NAR.id = structure(c(1L, 1L, 2L, 9L, 15L,
16L, 17L, 3L, 4L, 18L, 5L, 6L, 19L, 20L, 7L, 8L, 21L, 10L, 11L,
12L, 13L, 14L), .Label = c("", "-1", "04А ", "04Б ", "05А ",
"05Б ", "07Д ", "07С ", "1", "10", "11", "12Г ", "13", "15",
"2", "3", "4", "5", "6", "7", "9"), class = "factor"), X1000494 = structure(c(4L,
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 3L), .Label = c("", "0.00425531914893617", "0.0106382978723404",
"0.848936170212766"), class = "factor"), X1000495 = structure(c(4L,
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 3L), .Label = c("", "0.00651465798045603", "0.0293159609120521",
"0.892508143322475"), class = "factor"), X1000496 = structure(c(4L,
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
1L, 1L, 1L, 1L, 3L), .Label = c("", "0.00366300366300366", "0.0366300366300366",
"0.835164835164835"), class = "factor"), X1000500 = structure(c(3L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 2L), .Label = c("", "0.0161290322580645", "1.09032258064516"
), class = "factor")), .Names = c("KOD_NAR.id", "X1000494", "X1000495",
"X1000496", "X1000500"), class = "data.frame", row.names = c(NA,
-22L))
第二
mash=structure(list(KOD_NAR.id = structure(c(1L, 8L, 16L, 17L, 18L,
2L, 3L, 19L, 4L, 5L, 20L, 21L, 6L, 7L, 22L, 9L, 10L, 11L, 12L,
13L, 14L, 15L), .Label = c("-1", "04А ", "04Б ", "05А ", "05Б ",
"07Д ", "07С ", "1", "10", "11", "12Г ", "13", "15", "16",
"16А ", "2", "3", "4", "5", "6", "7", "9"), class = "factor"),
X1000494 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, 0L, 0L, NA), X1000495 = c(NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, 1L, 1L, NA), X1000496 = c(NA, NA, NA, NA, NA,
NA, NA, 0L, NA, NA, NA, NA, NA, NA, 0L, NA, NA, NA, NA, 2L,
0L, NA), X1000500 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0L, 0L, NA)), .Names = c("KOD_NAR.id",
"X1000494", "X1000495", "X1000496", "X1000500"), class = "data.frame", row.names = c(NA,
-22L))
我想以一种特殊的方式合并这些数据帧,即:文件结构是这样的:行是驱动程序的错误代码,而列是驱动程序的 ID。如何prop
通过相应的 KOD_NAR.id 将 mash 数据帧的标称数据加入数据帧的度量数据。然后在加入加载 excel 文件(write.xlsx
)后,用颜色标记的单元格。如果在括号中的单元格中为0,则颜色为绿色,如果为1,则颜色为黄色,如果为2,则单元格的颜色为红色
有办法吗?