1
私は、異なるグループのためのボックスプロットを並べて作成するのに苦労しています。Box-R for groups内のプロット
dput(df)
structure(list(UserName = structure(c(20L, 20L, 20L, 20L, 20L,
20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L,
20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L,
20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 21L, 21L, 21L, 21L, 21L,
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L,
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L,
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L,
21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L,
21L, 21L, 21L, 3L, 1L, 1L, 3L, 3L, 26L, 3L, 29L, 2L, 29L, 7L,
10L, 2L, 10L, 10L, 6L, 30L, 2L, 2L, 1L, 1L, 3L, 16L, 10L, 10L,
6L, 10L, 2L, 6L, 29L, 6L, 1L, 4L, 17L, 5L, 5L, 5L, 5L, 14L, 5L,
14L, 5L, 24L, 23L, 23L, 28L, 25L, 28L, 28L, 28L, 28L, 28L, 28L,
28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 31L, 31L,
4L, 27L, 27L, 27L, 12L, 12L, 12L, 12L, 19L, 19L, 22L, 12L, 11L,
11L, 11L, 9L, 22L, 12L, 15L, 22L, 22L, 22L, 11L, 9L, 11L, 12L,
11L, 18L, 18L, 22L, 22L, 18L, 18L, 19L, 22L, 22L, 19L, 19L, 22L,
19L, 11L, 19L, 15L, 22L, 19L, 19L, 9L, 19L, 19L, 9L, 18L, 12L,
18L, 22L, 8L, 13L, 13L, 13L), .Label = c("CYL", "FAL1",
"GS", "HA1", "HX", "HURRT", "KWY", "LEI", "L1",
"LIGYR", "LYC", "LJ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H",
"BTR", "IIT", "POL", "PTC", "PTP", "PTQ", "SPL", "TM"), class = "factor"),
SpoolUsage_max = structure(c(20L, 21L, 22L, 25L, 26L, 27L,
29L, 33L, 34L, 39L, 41L, 43L, 47L, 48L, 49L, 51L, 52L, 53L,
55L, 57L, 58L, 59L, 60L, 61L, 81L, 82L, 83L, 87L, 99L, 102L,
108L, 108L, 141L, 143L, 155L, 158L, 160L, 5L, 8L, 90L, 94L,
96L, 98L, 104L, 110L, 111L, 112L, 113L, 114L, 116L, 117L,
118L, 120L, 122L, 124L, 126L, 127L, 128L, 129L, 130L, 131L,
132L, 134L, 135L, 136L, 137L, 138L, 139L, 140L, 142L, 144L,
145L, 146L, 147L, 148L, 149L, 150L, 151L, 152L, 153L, 154L,
156L, 157L, 199L, 201L, 203L, 204L, 205L, 206L, 69L, 70L,
71L, 72L, 73L, 74L, 75L, 77L, 78L, 80L, 9L, 16L, 16L, 17L,
23L, 36L, 42L, 46L, 46L, 46L, 50L, 56L, 63L, 65L, 89L, 97L,
101L, 125L, 172L, 174L, 174L, 184L, 185L, 186L, 191L, 196L,
207L, 4L, 6L, 68L, 106L, 107L, 35L, 10L, 37L, 95L, 175L,
175L, 188L, 189L, 198L, 3L, 24L, 91L, 92L, 40L, 40L, 44L,
45L, 103L, 133L, 178L, 194L, 195L, 200L, 7L, 66L, 164L, 165L,
166L, 167L, 168L, 169L, 170L, 13L, 14L, 35L, 100L, 119L,
123L, 18L, 54L, 109L, 79L, 9L, 11L, 15L, 18L, 19L, 30L, 31L,
32L, 38L, 54L, 62L, 64L, 84L, 85L, 86L, 88L, 93L, 109L, 115L,
121L, 159L, 161L, 161L, 162L, 162L, 173L, 176L, 177L, 179L,
180L, 181L, 182L, 183L, 187L, 190L, 192L, 193L, 202L, 208L,
1L, 2L, 67L, 76L, 79L, 105L, 163L, 171L, 12L, 28L, 197L), .Label = c("1,002.12",
"1,027.99", "1,207.40", "1,368.90", "1,599.16", "1,616.11",
"1,804.20", "1,804.28", "106.09", "106.49", "106.5", "110.59",
"118.37", "119.12", "122.69", "123.19", "123.3", "123.49",
"125.19", "126.54", "128.72", "128.94", "132.43", "132.51",
"132.55", "135.45", "137.26", "141.87", "142.59", "145.93",
"146.11", "146.52", "147.22", "149.04", "149.27", "151.42",
"154.7", "155.61", "155.9", "156.07", "156.23", "157.8",
"158.92", "159.41", "160.22", "162.84", "163.45", "166.11",
"166.63", "170.96", "171.19", "172.73", "173.24", "176.51",
"176.56", "176.94", "177.75", "181.23", "184.5", "190.34",
"190.7", "193.7", "197.78", "199.66", "199.95", "2,007.44",
"2,009.54", "2,030.52", "2,273.26", "2,440.88", "2,473.26",
"2,633.03", "2,663.28", "2,706.98", "2,723.36", "2,755.44",
"2,759.55", "2,821.46", "2,829.16", "2,835.27", "200.27",
"204.97", "206.63", "208.96", "212.89", "216.38", "217.45",
"232.67", "234.05", "251.6", "253.61", "258.98", "262.16",
"266.48", "266.88", "268.92", "271.27", "276.31", "279.41",
"283.22", "289.51", "292.47", "292.67", "298.71", "3,003.51",
"3,184.47", "3,885.86", "305.69", "307.59", "308.38", "309.54",
"310.48", "313.8", "313.91", "314.72", "317.51", "319.85",
"321.54", "321.57", "321.63", "322.46", "327.56", "328.57",
"331.06", "331.85", "333.85", "333.9", "333.98", "334.28",
"335.22", "335.89", "336.63", "337.3", "337.74", "339.74",
"341.78", "345.12", "345.54", "347.99", "348", "348.13",
"348.48", "348.49", "349.3", "350.18", "350.53", "353.08",
"353.74", "353.98", "354.59", "355.55", "358.47", "359.14",
"359.59", "359.98", "361.84", "362.86", "370.08", "373.83",
"376.4", "394.45", "395.48", "4,166.39", "4,667.87", "4,696.73",
"4,708.79", "4,729.34", "4,731.65", "4,757.80", "4,760.75",
"4,769.30", "415.37", "421.52", "423.58", "428.34", "487.35",
"491.12", "495.1", "495.91", "495.94", "499.07", "517.68",
"527.29", "536.62", "550.83", "572.71", "574.75", "576.42",
"605.69", "613.56", "632.1", "668.87", "669.68", "686.88",
"688.05", "762.93", "770.16", "781.07", "858.09", "858.68",
"864.56", "868.03", "874.65", "879.09", "886.68", "890.64",
"911.58", "954.76"), class = "factor")), .Names = c("UserName",
"Division", "SpoolUsage_max"), class = "data.frame", row.names = c(NA,
-223L))
私は(自分のユーザーwithits各部門)各Division
ためのボックスプロットを取得するために並んでしようとしています。
:
library(reshape2)
library(ggplot2)
p <- ggplot(melt(df), aes(variable, value)) + geom_boxplot()
p <- p + geom_boxplot(fill = "grey80", colour = "#3366FF")
p <- p +xlab("UserName")+ylab("SpoolUsage_Max")+ggtitle("Spool Usage Analysis by Users")
p <- p +coord_flip()
p
私はここに行く側単一のボックスプロット