powered by
This function is a hack to avoid a problem with discounting when the argument is a constant.
discount_hack(.dots)
A modified state object.
A state object.
The hack consists in replacing calls to discount(x) by discount(x * rep(1, dplyr::n())) to ensure x is recycled to the correct length.
discount(x)
discount(x * rep(1, dplyr::n()))
x