Description Usage Arguments Value Examples
findPayout
determines the payout for each level based on a payout grid.
Essentially, for a vector of results against a vector of payouts p1..pn
it returns p[l] where l is the level, presumably found through
findLevel
. Note that while findLevel
potentially results in one
level greater than the number of thresholds, findPayout
requires a
payout for every level in the vector x.
1 | findPayout(x, p)
|
x |
A vector of levels to translate to a payout. |
p |
A vector of payout thresholds, sorted increasingly. |
vector of length length(x)
.
1 2 3 4 5 6 7 8 9 10 | x <- c(1,1,2,4)
p <- c(0, 500, 1000, 2000)
findPayout(x, p)
# [1] 0 0 500 2000
## Not run:
# Not enough payouts for the number of levels provided
x <- sample(rep(1:5, 20))
findPayout(x, p)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.