I have processed percentile data (P25/P50/P75):
area1 25650 26300 26950
area2 45825 49000 55000
area3 32768 32768 32768
Can I make a base boxplot
using this data in r?
I have processed percentile data (P25/P50/P75):
area1 25650 26300 26950
area2 45825 49000 55000
area3 32768 32768 32768
Can I make a base boxplot
using this data in r?
You can use the lower
, middle
and upper
aesthetic mappings in ggplot
:
library(ggplot2)
ggplot(data, aes(x=Group,
ymin = P25,
ymax = P75,
lower = P25,
middle = P50,
upper = P75,
fill = Group)) +
geom_boxplot(stat = "identity")
Data
data <- structure(list(Group = structure(1:3, .Label = c("area1", "area2",
"area3"), class = "factor"), P25 = c(25650L, 45825L, 32768L),
P50 = c(26300L, 49000L, 32768L), P75 = c(26950L, 55000L,
32768L)), row.names = c(NA, 3L), class = "data.frame")