From dc7accc60f1d1f56b919cdbb6fd6aa86220c6498 Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Wed, 22 May 2024 19:41:58 +0000 Subject: [PATCH] Good base to start lesson prep --- prep/Preparation-RStudio.Rmd | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/prep/Preparation-RStudio.Rmd b/prep/Preparation-RStudio.Rmd index b739610..7801ee6 100644 --- a/prep/Preparation-RStudio.Rmd +++ b/prep/Preparation-RStudio.Rmd @@ -20,7 +20,7 @@ library(ratdat) ## Lessons Snippits ```{r} -install.packages("ggplot2") +#install.packages("ggplot2") ``` ```{r} @@ -50,3 +50,24 @@ ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length)) ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length)) + geom_point() ``` + +```{r} +myplot <- ggplot(data = complete_old, mapping = aes(x = plot_type, y = hindfoot_length)) + + geom_jitter(aes(color = plot_type), alpha = 0.2) + + geom_boxplot(outlier.shape = NA, fill = NA) + +myplot + +myplot + + theme_bw() + + theme(axis.title = element_text(size = 14), + legend.position = "none", + panel.grid.major.x = element_blank()) + + labs(title = "Rodent size by plot type", + x = "Plot type", + y = "Hindfoot length (mm)", + color = "Plot type") + + facet_wrap(vars(sex), ncol = 1) + +``` +