The data includes sales tables of a fictitious bike store for April 2019.
Find the answer to the following questions:
#1.On which day did the store have the highest and lowest sales?
#2.Calculate the average of item sold for every week
#3.Calculate the difference between sales in consecutive weeks. (For example if first week ended with 100 bikes, and second with 170, answer is 70)
Please be advise that we deal with calendar weeks
#Data
Create vector of dates
dates ← seq(as.Date(“2023-03-01”), as.Date(“2023-03-31”), by = “day”)
Create vector with sold items
bikes_sold ← c(5, 3, 9, 12, 1, 7, 6, 15, 2, 10, 14, 11, 13, 8, 4, 5, 9, 1, 8, 2, 13, 11, 6, 14, 7, 3, 12, 4, 10, 15, 1)
Create data frame
bike_sales ← data.frame(Date = dates, bikes_sold = bikes_sold)
Feel free to use R online: https://rdrr.io/
Submission
Simply post your code and a screenshot of your results.
Please format your R code and blur it or place it in a hidden section.
Solution to this challenge will be posted on May 14