Description Usage Arguments Value Examples
This function analyses the content of a online shopping cart. It looks for the following information: How many items are sold in total, how many different items do we have, what's the maximum number of one item and at least how often do we have this 'maximum number of one item' within the shopping cart.
1 | analyseShoppingCart(shoppingCart)
|
shoppingCart |
shopping cart as an data.frame with one row for one item |
It returns a list with four numeric and named values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
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)
randomNumbers<- sample(1:10, 5, replace = T)
shoppingCart <- dplyr::bind_cols(books, number = randomNumbers)
analyseShoppingCart(shoppingCart)
```
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.