analyseShoppingCart: analyse the shopping cart

Description Usage Arguments Value Examples

Description

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.

Usage

1
analyseShoppingCart(shoppingCart)

Arguments

shoppingCart

shopping cart as an data.frame with one row for one item

Value

It returns a list with four numeric and named values.

Examples

 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)
```

frumentum/BuyPotterSaveMoney documentation built on May 15, 2019, 10:49 a.m.