text: user4595: I have a dataframe with 27 samples and for each of them I have different number of values
  I want to sum up the values for each sample, leaving each sample with a single value
  > dput(d[1:10,c(1,8)])
  structure(list(SampleID = c("LP6008460-DNA_A04", "LP6008460-DNA_A04", 
  "s30", "s30", "s67", "s15", "s67", "s67", "s67", "s30"), X.1 = c(8.17407e-05, 
  1.40067e-06, 3.86017e-05, 9.50247e-05, 7.08333e-07, 3.19133e-05, 
  3.1602e-05, 5.00513e-05, 3.29613e-05, 1.003e-06)), row.names = c(NA, 
  10L), class = "data.frame")
  > 
  
  I started to do that manually but that was a pain and inaccurate
  
  user3694: It's worth learning how to use dplyr for this sort of thing:
  dat %>% 
      dplyr::group_by(SampleID) %>% 
      dplyr::summarise(sample_mean = mean(X.1))
  
  # A tibble: 4 x 2
    SampleID          sample_mean
    <chr>                   <dbl>
  1 LP6008460-DNA_A04   0.0000416
  2 s15                 0.0000319
  3 s30                 0.0000449
  4 s67                 0.0000288
  
  
original_text: 4595: <p>I have a dataframe with 27 samples and for each of them I have different number of values</p>
  <p>I want to sum up the values for each sample, leaving each sample with a single value</p>
  <pre><code>&gt; dput(d[1:10,c(1,8)])
  structure(list(SampleID = c(&quot;LP6008460-DNA_A04&quot;, &quot;LP6008460-DNA_A04&quot;, 
  &quot;s30&quot;, &quot;s30&quot;, &quot;s67&quot;, &quot;s15&quot;, &quot;s67&quot;, &quot;s67&quot;, &quot;s67&quot;, &quot;s30&quot;), X.1 = c(8.17407e-05, 
  1.40067e-06, 3.86017e-05, 9.50247e-05, 7.08333e-07, 3.19133e-05, 
  3.1602e-05, 5.00513e-05, 3.29613e-05, 1.003e-06)), row.names = c(NA, 
  10L), class = &quot;data.frame&quot;)
  &gt; 
  </code></pre>
  <p>I started to do that manually but that was a pain and inaccurate</p>
   3694: <p>It's worth learning how to use <code>dplyr</code> for this sort of thing:</p>
  <pre><code>dat %&gt;% 
      dplyr::group_by(SampleID) %&gt;% 
      dplyr::summarise(sample_mean = mean(X.1))
  </code></pre>
  <pre><code># A tibble: 4 x 2
    SampleID          sample_mean
    &lt;chr&gt;                   &lt;dbl&gt;
  1 LP6008460-DNA_A04   0.0000416
  2 s15                 0.0000319
  3 s30                 0.0000449
  4 s67                 0.0000288
  </code></pre>
  