From 7e91b7eb8e52d0a3d94b2fbd33058159de69cf03 Mon Sep 17 00:00:00 2001 From: JD Avelar Date: Sun, 14 Feb 2021 12:07:20 -0800 Subject: [PATCH] Tinkering ...but not sure if I'm doing what's trying to be done with geom_col --- Lab3.Rmd | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Lab3.Rmd b/Lab3.Rmd index 8de2bb6..777712b 100644 --- a/Lab3.Rmd +++ b/Lab3.Rmd @@ -238,21 +238,20 @@ ggplot(purifiedhoney, aes(year, prodsimpler)) + regional_honey_production <- left_join(purifiedhoney, census_regions) %>% group_by(state, Region) %>% summarise(totalprod = mean(totalprod)) %>% - mutate(Region = as.factor(Region)) %>% - # mutate(Region = fct_reorder(Region, - # "Midwest", - # "West", - # "South", - # "Northeast")) - arrange(Region) - + ungroup() %>% + mutate(Region = as.factor(Region)) -ggplot(regional_honey_production, aes(state, totalprod, color = Region)) + - geom_col(aes(group = Region)) +# Leaving this in case we need it + fct_reorder(Region, + "Midwest", + "West", + "South", + "Northeast")) ``` ```{r bar plot showing average honey production, with color indicating region} - +ggplot(regional_honey_production, aes(reorder(state, -totalprod), totalprod, fill = Region)) + + geom_col(aes(group = Region)) ``` ```{r heatmap of average production by region}