This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.3.2
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
path_bike_orderlines <- "C:/Users/Badamkhand/Downloads/bike_orderlines (1) (1).rds"
bike_orderlines_tbl <- readRDS(path_bike_orderlines)
grouped_data <- bike_orderlines_tbl %>%
group_by(bikeshop_name) %>%
summarise(total_quantity = sum(quantity), count = n()) %>%
mutate(percentage = (total_quantity / sum(total_quantity)) * 100)
print(grouped_data)
## # A tibble: 30 × 4
## bikeshop_name total_quantity count percentage
## <chr> <dbl> <int> <dbl>
## 1 Albuquerque Cycles 286 207 1.42
## 2 Ann Arbor Speed 602 461 2.98
## 3 Austin Cruisers 246 192 1.22
## 4 Cincinnati Speed 391 298 1.94
## 5 Columbus Race Equipment 394 296 1.95
## 6 Dallas Cycles 234 182 1.16
## 7 Denver Bike Shop 2301 1801 11.4
## 8 Detroit Cycles 504 373 2.50
## 9 Indianapolis Velocipedes 319 231 1.58
## 10 Ithaca Mountain Climbers 1264 975 6.27
## # ℹ 20 more rows
You can also embed plots, for example:
Note that the echo = FALSE
parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.