Outputs a block_tibble after spending
per_block_spend on one block. Used in the
repair function. A new binary variable is created of the
of each building component within the block (later dropped in the
The building components are sorted by
descending grade and then descending cost in the
repair function prior to
being passed to this helper function.
a block dataframe or tibble with a
a scalar calculated from
This function works by first checking if there's anything to repair in the block. If not,
it returns the input argument
block_tibble. Only building components of
B, C or D are considered for repair. If a building component has a repair cost of zero
it is also ignored for repair (these two logical tests are applied using an "OR"). As the
passed tibble would have been sorted by grade and then cost the function proceeds through
the sorted dataframe repairing what building components it can until all the money is spent.
Money is divided evenly between each
buildingid or block based on the
block_tibble that has had building components ready to be
repaired or not indicated
by the new variable
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.