title: Use ggplot2 and tablegrob to plot grouped boxplots with summary statistics from multiple matrices with NA values
body: <p>I've searched around for a while but I still can't solve this minor issue in which I would like to change the decimal place of numbers in the table created by <code>tablegrob()</code>. Doing so would make the entire view look better, <strong>as seen below:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/d57K0.png" alt="enter image description here"></p>
  
  <p><strong>This is the code:</strong></p>
  
  <pre><code>a&lt;-as.vector(matrixA) #matrices A-D contain randomly generated NA and 
  b&lt;-as.vector(matrixB) #numerical values
  c&lt;-as.vector(matrixC)
  d&lt;-as.vector(matrixD)
  data &lt;- cbind(a, b, c, d)
  plot &lt;- melt(data)
  colnames(plot)[2]&lt;-"variable"
  plot&lt;-plot[,-1]
  levels(df$variable) &lt;- c("A", "B", "C",
                                    "D")
  xlabs &lt;- paste(levels(plot$variable),"\n(N=",
                 colSums(!is.na(data)),")",sep="")
  boxplot1&lt;-ggplot(na.omit(plot),aes(x=variable,y=value,color=variable))+
    geom_boxplot()+scale_x_discrete(labels=xlabs)+
    xlab("X") + ylab("Y")+ 
    ggtitle("Title")
  #create inset table
  multi.fun &lt;- function(x) {
    c(Mean = mean(x,na.rm=TRUE), Median = median(x,na.rm=TRUE), 
      IQR = IQR(x,na.rm=TRUE))}
  sum.table&lt;-data.frame(lapply(data.frame(a,b,c,d), multi.fun))
  colnames(sum.table)&lt;- c("A", "B", "C",
                          "D")
  my_table &lt;- tableGrob(sum.table, **digits=2**, gpar.coretext = gpar(fontsize=8), 
                        gpar.coltext=gpar(fontsize=8), gpar.rowtext=gpar(fontsize=8))
  #Create the viewports, push them, draw and go up
  grid.newpage()
  vp1 &lt;- viewport(width = 0.75, height = 1, x = 0.375, y = .5)
  subvp &lt;- viewport(width = 0.3, height = 0.3, x = 0.75, y = 0.20)
  print(boxplot1, vp = vp1)
  upViewport(0)
  pushViewport(subvp)
  grid.draw(my_table)
  </code></pre>
  
  <p>I tried adjusting the values using <strong><code>digits</code></strong> in <code>tablegrob</code>, which didn't work. I also tried <strong>options(digits=2)</strong>, which also didn't work. Any thoughts or ideas?</p>