count: false .panel1-the_chunk-auto[ ``` r *library(tidyverse) ``` ] .panel2-the_chunk-auto[ ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) *library(legendry) ``` ] .panel2-the_chunk-auto[ ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) *data.frame( * category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), * food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), * gram = c(85, 85, 150, 210, 225), * calories = c(245, 185, 45, 80, 240)) ``` ] .panel2-the_chunk-auto[ ``` category food gram calories 1 Meat Beef 85 245 2 Meat Chicken 85 185 3 Vegetables Carrots 150 45 4 Vegetables Onions 210 80 5 Dairy Cheese 225 240 ``` ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% * mutate(food_category = interaction(food, category)) ``` ] .panel2-the_chunk-auto[ ``` category food gram calories food_category 1 Meat Beef 85 245 Beef.Meat 2 Meat Chicken 85 185 Chicken.Meat 3 Vegetables Carrots 150 45 Carrots.Vegetables 4 Vegetables Onions 210 80 Onions.Vegetables 5 Dairy Cheese 225 240 Cheese.Dairy ``` ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> * ggplot() ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + * theme_classic() ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + * aes(food_category, calories) ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + * geom_col() ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + * guides(x = "axis_nested") ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + * labs(x = NULL) ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + labs(x = NULL) + * guides(y = guide_axis_nested(key_range_manual(0, 100, "low calories"))) ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + labs(x = NULL) + guides(y = guide_axis_nested(key_range_manual(0, 100, "low calories"))) + * aes(fill = paste(category, food)) ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + labs(x = NULL) + guides(y = guide_axis_nested(key_range_manual(0, 100, "low calories"))) + aes(fill = paste(category, food)) + * guides(fill = "legend_group") ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + labs(x = NULL) + guides(y = guide_axis_nested(key_range_manual(0, 100, "low calories"))) + aes(fill = paste(category, food)) + guides(fill = "legend_group") + * labs(fill = NULL) ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + labs(x = NULL) + guides(y = guide_axis_nested(key_range_manual(0, 100, "low calories"))) + aes(fill = paste(category, food)) + guides(fill = "legend_group") + labs(fill = NULL) + * theme_classic() ``` ] .panel2-the_chunk-auto[ <!-- --> ] --- count: false .panel1-the_chunk-auto[ ``` r library(tidyverse) library(legendry) data.frame( category = c("Meat", "Meat", "Vegetables", "Vegetables", "Dairy"), food = c("Beef", "Chicken", "Carrots", "Onions", "Cheese"), gram = c(85, 85, 150, 210, 225), calories = c(245, 185, 45, 80, 240)) %>% mutate(food_category = interaction(food, category)) |> ggplot() + theme_classic() + aes(food_category, calories) + geom_col() + guides(x = "axis_nested") + labs(x = NULL) + guides(y = guide_axis_nested(key_range_manual(0, 100, "low calories"))) + aes(fill = paste(category, food)) + guides(fill = "legend_group") + labs(fill = NULL) + theme_classic() + * theme(axis.text.y.left = element_text(angle = 90, hjust = 0.5)) ``` ] .panel2-the_chunk-auto[ <!-- --> ] <style> .panel1-the_chunk-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-the_chunk-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-the_chunk-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> <style type="text/css"> .remark-code{line-height: 1.5; font-size: 120%} @media print { .has-continuation { display: block; } } code.r.hljs.remark-code{ position: relative; overflow-x: hidden; } code.r.hljs.remark-code:hover{ overflow-x:visible; width: 500px; border-style: solid; } </style>