Description Usage Arguments Details Value Examples
This function contains all the input validity checks used by the
Blockbuster
function. It produces messages and warnings about
common scenarios, and errors for invalid data inputs. Currently this function
will only report the first error that occurs.
1 2 3 |
element.data |
An element-level data frame. |
block.data |
A block-level data frame. |
forecast.horizon |
An integer. |
rebuild.money |
A numeric vector |
repair.money |
A numeric vector |
block.rebuild.cost |
A number |
inflation |
A numeric vector |
If block.data
is not provided, this function will generate
the block-level data.frame.
forecast.horizon
must be a single positive number.
inflation
, rebuild.money
and repair.money
must be
numeric. If either is a single number then a message is displayed stating
that it will be used for each year. If vectors are passed to these arguments,
their length must be equal or greater than forecast.horizon
, with the
additional values being ignored and a message displayed. Negative values
will throw an error. A message is displayed if inflation
seems
excessive (over 200
block.rebuild.cost
is checked to be a positive number. If a vector is
passed, the values beyond the first will be ignored and a message displayed.
The input is returned as is, with the addition of a block-level data
frame if block.data = NULL
.
1 2 3 4 5 6 7 8 9 10 | # run input checks on a 10 year simulation with no rebuilding, £1M repair
# budget each year with £2,000 unit rebuild cost and no inflation. The block-
# level data frame is not supplied and will be generated.
blockbuster2:::input_checks(element.data = simulated_elements,
block.data = NULL,
forecast.horizon = 10,
rebuild.money = 0,
repair.money = 1000000,
block.rebuild.cost = 2000,
inflation = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.