title: R: How to colour samples on a boxplot by their group?
body: <p>I currently have gene expression data in a matrix, arranged by samples in columns, and genes in rows. I have about 300 samples against 30,000 genes. </p>
  
  <p>There first three lines of the data is as such:</p>
  
  <pre><code>         Sample1  Sample2  Sample3   Sample4   Sample5
  Gene1    6.53845  6.38723  6.41613   6.07901   6.45148
  Gene2    6.34303  6.52751  6.48025   6.79185   6.94955
  Gene3    6.17286  6.31772  6.44266   6.61777   7.05509
  ...      ...    
  </code></pre>
  
  <p>And so on for up to 30,000 rows, and 300 samples.</p>
  
  <p>I have been able to plot a boxplot of the data using R, but I am now looking to colour the boxplot based on the batches/groups of the sample. </p>
  
  <p>I have a table of the batch information as such.</p>
  
  <pre><code>Sample   Batch
  Sample1  A
  Sample2  A
  Sample3  B
  Sample4  A
  Sample5  C
  ...      ...
  </code></pre>
  
  <p>And so on for 8 batches. Using R, how should I go about colouring the boxplot based on which batch the sample belongs to? Thanks!</p>