title: Fill rows of a data frame by group in R
body: <p>I would like to transform this data frame:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>date</th>
  <th>X</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>001</td>
  <td>2022-04-12</td>
  <td>dsf</td>
  </tr>
  <tr>
  <td>001</td>
  <td>2022-04-13</td>
  <td>df</td>
  </tr>
  <tr>
  <td>001</td>
  <td>2022-04-14</td>
  <td>sdw</td>
  </tr>
  <tr>
  <td>002</td>
  <td>2022-04-12</td>
  <td>we3</td>
  </tr>
  <tr>
  <td>002</td>
  <td>2022-04-13</td>
  <td>r45</td>
  </tr>
  <tr>
  <td>002</td>
  <td>2022-04-14</td>
  <td>2s</td>
  </tr>
  <tr>
  <td>003</td>
  <td>2022-04-12</td>
  <td>de65</td>
  </tr>
  <tr>
  <td>003</td>
  <td>2022-04-13</td>
  <td>hjk</td>
  </tr>
  <tr>
  <td>004</td>
  <td>2022-04-12</td>
  <td>vcbdf</td>
  </tr>
  <tr>
  <td>005</td>
  <td>2022-04-12</td>
  <td>342f</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>to this one:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>date</th>
  <th>X</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>001</td>
  <td>2022-04-12</td>
  <td>dsf</td>
  </tr>
  <tr>
  <td>001</td>
  <td>2022-04-13</td>
  <td>df</td>
  </tr>
  <tr>
  <td>001</td>
  <td>2022-04-14</td>
  <td>sdw</td>
  </tr>
  <tr>
  <td>002</td>
  <td>2022-04-12</td>
  <td>we3</td>
  </tr>
  <tr>
  <td>002</td>
  <td>2022-04-13</td>
  <td>r45</td>
  </tr>
  <tr>
  <td>002</td>
  <td>2022-04-14</td>
  <td>2s</td>
  </tr>
  <tr>
  <td>003</td>
  <td>2022-04-12</td>
  <td>de65</td>
  </tr>
  <tr>
  <td>003</td>
  <td>2022-04-13</td>
  <td>hjk</td>
  </tr>
  <tr>
  <td>003</td>
  <td>2022-04-14</td>
  <td>NA</td>
  </tr>
  <tr>
  <td>004</td>
  <td>2022-04-12</td>
  <td>vcbdf</td>
  </tr>
  <tr>
  <td>004</td>
  <td>2022-04-13</td>
  <td>NA</td>
  </tr>
  <tr>
  <td>004</td>
  <td>2022-04-14</td>
  <td>NA</td>
  </tr>
  <tr>
  <td>005</td>
  <td>2022-04-12</td>
  <td>342f</td>
  </tr>
  <tr>
  <td>005</td>
  <td>2022-04-13</td>
  <td>NA</td>
  </tr>
  <tr>
  <td>005</td>
  <td>2022-04-14</td>
  <td>NA</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>As you can see, the date target is from 2022-04-12 to 2022-04-14, so the rows without all the dates should be filled.</p>
  <p>Any idea?</p>