Это исходные данные. Кадр
temp <- structure(list(Initial = c(
32.5, 30.4, 36.5, 4.2, 24.3
), Amount = c(
374.24, 79.05, 1.02, 0.79, 0.71
), Load = c(
11.512, 2.605, 0.027, 0.021, 0.019
), Extra = c(
36.9, 32.5, 12.2, 12.2, 12.2
), Perc = c(
114L, 107L, 33L, 33L, 33L
)), row.names = c(
1L, 2L, 3L, 4L, 5L
), class = "data.frame")
Это то, что я хочу создать. Я бы предпочел тидиверс
data <- structure(list(Rs = c(
"Initial", "Initial", "Initial", "Initial",
"Initial", "Initial", "Initial", "Initial", "Initial", "Initial",
"Initial", "Initial", "Initial", "Initial", "Initial", "Initial",
"Initial", "Initial", "Initial", "Initial", "Amount", "Amount",
"Amount", "Amount", "Amount", "Amount", "Amount", "Amount", "Amount",
"Amount", "Amount", "Amount", "Amount", "Amount", "Amount", "Load",
"Load", "Load", "Load", "Load", "Load", "Load", "Load", "Load",
"Load", "Extra", "Extra", "Extra", "Extra", "Extra"
), Rvalue = c(
32.5,
30.4, 36.5, 4.2, 24.3, 32.5, 30.4, 36.5, 4.2, 24.3, 32.5, 30.4,
36.5, 4.2, 24.3, 32.5, 30.4, 36.5, 4.2, 24.3, 374.24, 79.05,
1.02, 0.79, 0.71, 374.24, 79.05, 1.02, 0.79, 0.71, 374.24, 79.05,
1.02, 0.79, 0.71, 11.512, 2.605, 0.027, 0.021, 0.019, 11.512,
2.605, 0.027, 0.021, 0.019, 36.9, 32.5, 12.2, 12.2, 12.2
), Cs = c(
"Amount",
"Amount", "Amount", "Amount", "Amount", "Load", "Load", "Load",
"Load", "Load", "Extra", "Extra", "Extra", "Extra", "Extra",
"Perc", "Perc", "Perc", "Perc", "Perc", "Load", "Load", "Load",
"Load", "Load", "Extra", "Extra", "Extra", "Extra", "Extra",
"Perc", "Perc", "Perc", "Perc", "Perc", "Extra", "Extra", "Extra",
"Extra", "Extra", "Perc", "Perc", "Perc", "Perc", "Perc", "Perc",
"Perc", "Perc", "Perc", "Perc"
), Cvalue = c(
374.24, 79.05, 1.02,
0.79, 0.71, 11.512, 2.605, 0.027, 0.021, 0.019, 36.9, 32.5, 12.2,
12.2, 12.2, 114, 107, 33, 33, 33, 11.512, 2.605, 0.027, 0.021,
0.019, 36.9, 32.5, 12.2, 12.2, 12.2, 114, 107, 33, 33, 33, 36.9,
32.5, 12.2, 12.2, 12.2, 114, 107, 33, 33, 33, 114, 107, 33, 33,
33
)), class = "data.frame", row.names = c(NA, -50L))