You are on page 1of 2

1) Download and Install free R studio from the following link.

(Provide a
screenshot)

https://posit.co/download/rstudio-desktop/

2) Download and load the dataset into an R datagram. (Provide a screenshot)

https://lms.digiskills.pk/Courses/DBI101/Downloads/supermarket_sales%20-
%20Sheet1.csv

supermarket sales <- read.csv("supermarket_sales.csv")

3) Obtain the summary statistics for all columns in the dataset. (Provide a
screenshot)

descriptive stats <- summary(supermarket sales)

4) Calculate the total sales for each branch in the dataset. (Provide a screenshot)

sales_by_branch <- aggregate (supermarket_sales$Total ~


supermarket_sales$Branch,

supermarket_sales , sum)

5) Compute the total sales for each gender. (Provide a screenshot)

sales_by_gender <- aggregate(supermarket sales $Total ~ supermarket sales


$Gender,
supermarket sales, sum)

You might also like