title: How to create box plot displaying mean and standard deviation and a scatterplot of points as well
body: <p>I am attempting to create a box plot displaying mean and standard deviation and a scatterplot of points in the software R by modifying the code below.</p>
  
  <pre><code>library(ggplot2)
  
  # create fictitious data
  a &lt;- runif(10)
  b &lt;- runif(12)
  c &lt;- runif(7)
  d &lt;- runif(15)
  
  # data groups
  group &lt;- factor(rep(1:4, c(10, 12, 7, 15)))
  
  # dataframe
  mydata &lt;- data.frame(c(a,b,c,d), group)
  names(mydata) &lt;- c("value", "group")
  
  # function for computing mean, DS, max and min values
  min.mean.sd.max &lt;- function(x) {
    r &lt;- c(min(x), mean(x) - sd(x), mean(x), mean(x) + sd(x), max(x))
    names(r) &lt;- c("ymin", "lower", "middle", "upper", "ymax")
    r
  }
  
  # ggplot code
  p1 &lt;- ggplot(aes(y = value, x = factor(group)), data = mydata)
  p1 &lt;- p1 + stat_summary(fun.data = min.mean.sd.max, geom = "boxplot") + geom_jitter(position=position_jitter(width=.2), size=3) + ggtitle("Boxplot con 
     media, 95%CI, valore min. e max.") + xlab("Gruppi") + ylab("Valori")
  </code></pre>
  
  <p>This is my dataset:</p>
  
  <pre><code>number  name    percent
  1   CD1_lung1   0.824214533
  3   CD1_lung2   1.118706494
  5   CD1_lung3   1.271139637
  7   CD1_lung4   0.785939335
  9   CNR_20  0.592576592
  11  CNR_lung    1.764129689
  13  CNR_2   0.643293719
  2   Gpc_KO1_lung    0.730014957
  4   Gpc_KO2_lung    0.679556429
  6   Gpc_KO3_lung    1.00910329
  8   KO12    1.074708817
  10  Gpc1_hom_lung   1.86280637
  12  KO35    0.521546931
  14  KO45    0.486304707
  </code></pre>
  
  <p>I loaded it into R using read.table("C:/Users/me/Desktop/WB0823_m1/wb0823R.txt", header = TRUE); however, I'm stuck on what to do next since I'm very new to using R. If there's an easier way to create this boxplot in MATLAB or Stata instead, I'd like to know too please! I was not able to figure it out for either of those two softwares either.</p>