title: Reshaping data.frame in R from wide to long format
body: <p>I have data something like this.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>new_death</th>
  <th>beds_covid</th>
  <th>beds_noncrit</th>
  <th>beds_icu_covid</th>
  <th>icu_covid</th>
  <th>vent_covid</th>
  <th>hosp_covid</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>0</td>
  <td>434</td>
  <td>1408</td>
  <td>10</td>
  <td>0</td>
  <td>0</td>
  <td>18</td>
  </tr>
  <tr>
  <td>1</td>
  <td>143</td>
  <td>1183</td>
  <td>16</td>
  <td>2</td>
  <td>1</td>
  <td>46</td>
  </tr>
  <tr>
  <td>2</td>
  <td>280</td>
  <td>1424</td>
  <td>20</td>
  <td>1</td>
  <td>1</td>
  <td>78</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want to change the table into something like this.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>new_death</th>
  <th>variable</th>
  <th>value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>0</td>
  <td>beds_covid</td>
  <td>434</td>
  </tr>
  <tr>
  <td>0</td>
  <td>beds_noncrit</td>
  <td>1408</td>
  </tr>
  <tr>
  <td>0</td>
  <td>beds_icu_covid</td>
  <td>10</td>
  </tr>
  <tr>
  <td>0</td>
  <td>icu_covid</td>
  <td>0</td>
  </tr>
  <tr>
  <td>0</td>
  <td>vent_covid</td>
  <td>0</td>
  </tr>
  <tr>
  <td>0</td>
  <td>hosp_covid</td>
  <td>18</td>
  </tr>
  <tr>
  <td>1</td>
  <td>beds_covid</td>
  <td>143</td>
  </tr>
  <tr>
  <td>1</td>
  <td>beds_noncrit</td>
  <td>1183</td>
  </tr>
  <tr>
  <td>1</td>
  <td>beds_icu_covid</td>
  <td>16</td>
  </tr>
  <tr>
  <td>1</td>
  <td>icu_covid</td>
  <td>2</td>
  </tr>
  <tr>
  <td>1</td>
  <td>vent_covid</td>
  <td>1</td>
  </tr>
  <tr>
  <td>1</td>
  <td>hosp_covid</td>
  <td>46</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Thank you.</p>