title: Formatting repeated date data in time dependent survival format
body: <p>referencing the following manual for time dependent survival in R:</p>
  <p><a href="https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf</a></p>
  <p>From the vignette example:</p>
  <pre><code>subject time1 time2 death creatinine
   5       0     90    0     0.9
   5       90    120   0     1.5
   5       120   185   1     1.2
  </code></pre>
  <p>The data I have is in the following format:</p>
  <p>In dd-mm-yyyy format</p>
  <pre><code>subject date           death creatinine
   5       01-01-2022     0     0.9
   5       01-04-2022     0     1.5
   5       01-05-2022     0     1.2
   5        05-07-2022     1     1.2
  </code></pre>
  <p>I need to format the data below to match to the data above.</p>