Chapter 2 Introduction
Eun Ji Kim 2114009 Department of Nutritional Science and Food Management
head(iris)
library(tidyverse) iris %>% pivot_longer(cols = -Species, names_to = “Part,” values_to = “Value”) %>% separate(col = “Part,” into = c(“Part,” “Measure”))
iris %>% pivot_longer(cols = -Species, names_to = “Part,” values_to = “Value”) %>% separate(col = “Part,” into = c(“Part,” “Measure”)) %>% group_by(Species, Part) %>% summarize(m = mean(Value))
iris %>% pivot_longer(cols = -Species, names_to = “Part,” values_to = “Value”) %>% separate(col = “Part,” into = c(“Part,” “Measure”)) %>% ggplot(aes(x = Value, color = Part)) + geom_boxplot()
You can write citations, too. For example, we are using the bookdown package (Xie 2020) in this sample book, which was built on top of R Markdown and knitr (Xie 2015).