# 1. Model update --------------------------------------------------------- # 2. Custom plot function ------------------------------------------------- his <- hist(trees$Girth, freq = FALSE) dens <- density(trees$Girth) ymax <- max(his$density, dens$y) plot(his, freq = FALSE, ylim = c(0, ymax), xlab = "Girth", main = "Histogram of Girth") lines(dens) # 3. Custom ggplot function ----------------------------------------------- library(ggplot2) mycol <- c("blue", "orange", "green") ggplot(iris, aes(x = Petal.Length, y = Petal.Width, color = Species)) + geom_point() + scale_color_manual(values = mycol) + xlab("Petal Length") + ylab("Petal Width") + theme_light() + theme(legend.key = element_blank()) #remove boxes in legend # 4. Custom data tidying --------------------------------------------------- library(readr) library(dplyr) read_table("2008-9.txt") %>% rename(Home = X1) # 5. Custom kable ---------------------------------------------------------