title: Sequential generation of columns based on multiple existing columns
body: <p>I have a data frame that looks like this:</p>
  
  <pre><code> df &lt;- data.frame(project = c("A", "B"),
                    no_dwellings = c(150, 180),
                    first_occupancy = c(2020, 2019))
  
    project no_dwellings first_occupancy
  1       A          150            2020
  2       B          180            2019
  </code></pre>
  
  <p><code>project</code> is a column identifying residential building areas, <code>no_dwellings</code> denotes how many dwellings are ultimately being constructed in these areas, and <code>first_occupancy</code> is an estimate as to when the first residents will start moving into the newly constructed apartments.</p>
  
  <p>I need to incorporate this information into a population forecast. The best estimate we have is that in each year (starting with <code>first occupancy</code>), 60 of the dwellings are being moved into. Thus, I need to sequentially generate columns that combine the information from <code>first_occupancy</code> and <code>no_dwellings</code> to indicate for each year how many dwellings are likely to be moved into. Since the number of constructed dwellings does not necessarily divide by 60, the remainder needs to be put into the last column for the respective project.</p>
  
  <p>This is what I expect my data frame to look like for further processing:</p>
  
  <pre><code>  project no_dwellings first_occupancy year_2019 year_2020 year_2021 year_2022
  1       A          150            2020         0        60        60        30
  2       B          180            2019        60        60        60         0
  </code></pre>