i have two dataframes
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))
The second
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))
i want merge these dataframes but in a special way, namely:
the file structure is such that by the rows the error's code of the driver, and by the columns the driver's ID.
How can i join to the metric data of prop
dataframe the nominal data of mash dataframe by corresponding KOD_NAR.id. and then after joining load excel file( write.xlsx
) with marked cells by color . If in the cell in brackets 0, then color is green, if 1, then color is yellow, if 2, then color of cells is red
is there way to do it?