Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
448 views
in Technique[技术] by (71.8m points)

r - Boxplot wih wrong whiskers (line until ymax and ymin)

For some reason I do not get a correct boxplot (the line that runs til ymax and ymin) This is the code I have used:

MinMeanSEMMax <- function(x) {
  v <- c(min(x), 
         mean(x) - sd(x)/sqrt(length(x)), 
         mean(x), 
         mean(x) + sd(x)/sqrt(length(x)),
         max(x))
  names(v) <- c("ymin", "lower", "middle", "upper", "ymax")
  v
}
p <- ggplot(Combined_Baseline_DataIL1beta, 
            aes(x=Diagnosis, y=Nonaffected_Ileum, color=Diagnosis)) + 
  stat_summary(fun.data = MinMeanSEMMax, geom = "boxplot") +
  geom_jitter(shape=16, position=position_jitter(0.2)) +
  stat_boxplot(geom = 'errorbar') +
  ggtitle("Number of IL-1 beta positive cells in the non-affected ileum") +
  ylab("Number of IL-1 beta positive cells per mm2")
p 

Does anyone have some advice?

question from:https://stackoverflow.com/questions/65844242/boxplot-wih-wrong-whiskers-line-until-ymax-and-ymin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...