title: How to summarize multiple columns at once?
body: <p>I am trying to create a table with the Sample ID, raw counts, and Gene names.</p>
  <p>In this table, a new row is created for each Sample Id to correspond to each gene name:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Sample ID</th>
  <th style="text-align: center;">Gene A</th>
  <th style="text-align: right;">Gene B</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Sample 1</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">-</td>
  </tr>
  <tr>
  <td style="text-align: left;">Sample 1</td>
  <td style="text-align: center;">-</td>
  <td style="text-align: right;">2</td>
  </tr>
  <tr>
  <td style="text-align: left;">Sample 2</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: right;">-</td>
  </tr>
  <tr>
  <td style="text-align: left;">Sample 2</td>
  <td style="text-align: center;">-</td>
  <td style="text-align: right;">4</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Rather than having numerous rows, I would like to condense them into a single row:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Sample ID</th>
  <th style="text-align: center;">Gene A</th>
  <th style="text-align: right;">Gene B</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">Sample 1</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">2</td>
  </tr>
  <tr>
  <td style="text-align: left;">Sample 2</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: right;">4</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>This is the code I have so far:</p>
  <pre class="lang-r prettyprint-override"><code>dfwide = data.wide.df %&gt;% group_by(SampleId) %&gt;%
  summarise(Sample 1 = sum(Sample 1, na.rm = T),
  Sample 2 = sum(Sample 2, na.rm = T))
  </code></pre>
  <p>I have over 1000 samples, so I was hoping to find a way to summarise all the genes at once. Any help would be appreciated!</p>