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:
category_sales
## # A tibble: 9 × 3
## # Groups: category_1 [2]
## category_1 category_2 total_sales
## <chr> <chr> <dbl>
## 1 Road Elite Road 4483
## 2 Mountain Cross Country Race 3683
## 3 Road Endurance Road 3322
## 4 Mountain Trail 2569
## 5 Mountain Sport 2177
## 6 Mountain Over Mountain 1514
## 7 Road Triathalon 1149
## 8 Road Cyclocross 901
## 9 Mountain Fat Bike 374
combinations <- bike_orderlines %>%
group_by(category_1, category_2) %>%
summarise(frame_materials = n_distinct(frame_material)) %>%
filter(frame_materials == 2)
## `summarise()` has grouped output by 'category_1'. You can override using the
## `.groups` argument.
if (nrow(combinations) == 0) {
cat("All combinations contain both Aluminum and Carbon frame materials.")
} else
cat("Not all combinations contain both Aluminum and Carbon frame materials.")
## Not all combinations contain both Aluminum and Carbon frame materials.
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.