Use dplyr commands to calculate the median sales by payment type
payment_type <- group_by(supermarket_raw,payment)
median_sales=summarize(payment_type,x=median(total))
print(median_sales)
2. You are asked to develop a new performance indicator for the company. You wonder if the transaction rating per unit price might provide insights into consumer preferences for different product lines. Calculate the rating per unit price for each transaction and call this new variable rup.
rup <- mutate(supermarket_raw,rating_per_unit_price=rating/unit_price)
3. Then calculate the mean rup and unit price by product line across the dataset. Print the contents of this dataframe into the console using the print() function.
supermarket_sales_grouped_product_line <- group_by(rup,product_line)
mean_unit_price_by_product_line <- summarize(supermarket_sales_grouped_product_line,mean_unit_price=mean(unit_price))
mean_rup_by_product_line <- summarize(supermarket_sales_grouped_product_line,mean_rup=mean(rating_per_unit_price))
super_reconstruct <- bind_rows(mean_rup_by_product_line,mean_unit_price_by_product_line)
print(super_reconstruct)
What times of day have the highest and lowest total sales? Explain what this means for staffing in the figure caption. Name the worksheet with this visualization PS3_01.
2. Are there differences in peak sales hours across the three store branches? Explain what this means for staffing in the figure caption. Name the worksheet with this visualization PS3_02.
Now suppose that staffing needs are determined within departments. Department 1 includes products in the Fashion Accessories and Health and Beauty product lines. Department 2 includes products in the Food and Beverages and Home and Lifestyle product lines. Department 3 includes products in the Electronic Accessories and Sports and Travel product lines.
How do sales differ across departments in Yangon? Explain what this means for staffing in the figure caption. Name the worksheet with this visualization PS3_03.
4. What percent of total sales in Yangon occur in Department 2 on Sundays? Explain what this means for staffing in the figure caption. Name the worksheet with this visualization PS3_04.
5. On which day of the week does Department 1 account for the largest percentage of total sales in Yangon? Explain what this means for staffing in the figure caption. Name the worksheet with this visualization PS3_05.