library(tidyverse)
met <- read_csv("https://denvirlab.marshall.edu/BMR617-2021/data/TH-B6-metabolic.csv") %>%
  separate(MouseID, sep="-", into=c("Strain","Diet","Id"))


ggplot(met, aes(x=Strain, y=Cholesterol))

ggplot(met, aes(x=Strain, y=Cholesterol)) + geom_boxplot()

ggplot(met, aes(x=Strain, y=Cholesterol)) + geom_point()

ggplot(met, aes(x=Strain, y=Cholesterol)) + 
  geom_point(position=position_jitter(width=0.1))

ggplot(met, aes(x=Strain, y=Cholesterol)) + 
  geom_bar(stat="summary", fun="mean")

ggplot(met, aes(x=Diet, y=Cholesterol)) + geom_boxplot()

ggplot(met, aes(x=Diet, y=Cholesterol)) + geom_point(position=position_jitter(width=0.1))

ggplot(met, aes(x=Strain, y=Cholesterol)) + 
  geom_boxplot() + 
  geom_point(position=position_jitter(width=0.1))


ggplot(met, aes(x=Diet, y=Cholesterol)) + 
  geom_boxplot() + geom_point(position=position_jitter(width=0.1))


ggplot(met, aes(x=Diet, y=Cholesterol)) + geom_boxplot(fill="#00b140")

ggplot(met, aes(x=Diet, y=Cholesterol)) + geom_boxplot(aes(fill=Strain))


ggplot(met, aes(x=Diet, y=Cholesterol, fill=Strain)) + 
  geom_boxplot() + 
  scale_fill_manual(values=c("red","blue"))

ggplot(met, aes(x=Diet, y=Cholesterol, fill=Strain)) + geom_boxplot() + 
  geom_point(position=position_dodge(width=0.75))

png("figure1.png")
ggplot(met, aes(x=Diet, y=Cholesterol, fill=Strain)) + geom_boxplot() + 
  geom_point(position=position_jitterdodge(jitter.width = 0.1, dodge.width = 0.75))
dev.off()
