CommencerCommencer gratuitement

Single basket

In the following exercises, you will be working with a dataset containing transactions of an e-commerce retail company based in the UK. These transactions consist of all transactions in the first quarter of 2011.

You will in particular have a closer look at a single basket from this dataset. It will be your turn to figure out the total basket size and the number of distinct products.

The dataset called Online_Retail_2011_Q1 is available in your workspace. Some important columns of the dataset are:

  • StockCode: number uniquely assigned to each distinct product;
  • InvoiceNo: number uniquely assigned to each transaction;
  • Description: description of the product;
  • Quantity: quantity purchased per transaction.

Cet exercice fait partie du cours

Market Basket Analysis in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Have a glimpse at the dataset
glimpse(Online_Retail_2011_Q1)

# Filter a single basket
One_basket = Online_Retail_2011_Q1 %>%
				___(___ == 540180)

___(___)
Modifier et exécuter le code