whoPays | R Documentation |
This is an internal function. It should not be called directly by the user.
whoPays(pos, neg)
pos |
Numeric vector containing the amount of money some people in the group have spend in excess and should be reimbursed of. Idealy, the vector should have a name for each value. |
neg |
Numeric vector containing the amount of money some people in the group should reimburse to balance the spendings. Idealy, the vector should have a name for each value. |
A list of 2 numerical vectors. Remb
contains the values that a set of people need to spend to reimburse the first person in the pos
vector. Reste
contains the value that each debtor has still to spend to reimburse the remaining people in the pos
vector.
pos <- c(125, 346)
names(pos) <- c("John", "Gail")
neg <- c(28, 312, 41, 90)
names(neg) <- c("Mike", "Lenny", "Christine", "Sally")
whoPays(pos,neg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.