I use the following commond to generate pairwise boxplot. The ctrp.boxdata looks like:
drug auc p group
1 paclitaxel 0.2077276 0.0004955335 High PPS
2 paclitaxel 0.1772445 0.0004955335 High PPS
3 paclitaxel 0.1599633 0.0004955335 High PPS
4 paclitaxel 0.1564113 0.0004955335 High PPS
5 paclitaxel 0.1737403 0.0004955335 High PPS
6 paclitaxel 0.2429842 0.0004955335 High PPS
...
drug auc p group
139 clofarabine 0.4589299 0.0002743925 Low PPS
140 clofarabine 0.3600058 0.0002743925 Low PPS
141 clofarabine 0.4433972 0.0002743925 Low PPS
142 clofarabine 0.3785587 0.0002743925 Low PPS
143 clofarabine 0.3744288 0.0002743925 Low PPS
144 clofarabine 0.3954452 0.0002743925 Low PPS
p <- ggplot(ctrp.boxdata, aes(drug, auc, fill=group)) +
geom_boxplot(aes(col = group),outlier.shape = NA) +
geom_text(aes(drug, y=min(ctrp.boxdata$auc) * 1.1,
label=paste("p = ",formatC(p,format = "e",digits = 1))),
data=ctrp.boxdata,
inherit.aes=F) +
scale_fill_manual(values = c("#0772B9","#48C8EF")) +
scale_color_manual(values = c("#0772B9","#48C8EF")) +
xlab(NULL) + ylab("Estimated AUC value")
I want to change the color of median line and I followed this thread:
dat <- ggplot_build(p)$data[[1]]
p + geom_segment(data=dat, aes(x=xmin, xend=xmax, y=middle, yend=middle), color="white", size=2)
but it got me an error:
Error: Continuous value supplied to discrete scale
Any solutions?