Description Usage Arguments Value Examples
Based on analyseShoppingCart()
and
enumerateCombinations()
this function provides filtered but possible
discount sets.
1 | extractDiscountSets(alternatives, intermediateSteps = FALSE)
|
alternatives |
|
intermediateSteps |
logical; default is |
If intermediateSteps
is set to TRUE
, a list will be
returned; otherwise a matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
# These books are available in the shop
books <- dplyr::tibble(
itemID = 1:5,
name = c(
"Stein der Weisen",
"Kammer des Schreckens",
"Gefangene von Askaban",
"Feuerkelch",
"Orden des Phönix"
)
)
set.seed(1)
shoppingCart <- dplyr::sample_n(books, 15, replace = TRUE) %>%
dplyr::arrange(itemID)
ls <- analyseShoppingCart(shoppingCart, itemID, name)
alternatives <- enumerateCombinations(ls)
extractDiscountSets(alternatives)
```
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.