R Markdown

##      county      county_name           pop2018           ec_county     
##  Min.   : 1001   Length:3089        Min.   :     544   Min.   :0.2947  
##  1st Qu.:18161   Class :character   1st Qu.:   12630   1st Qu.:0.6956  
##  Median :29135   Mode  :character   Median :   27887   Median :0.8068  
##  Mean   :30219                      Mean   :  108010   Mean   :0.8145  
##  3rd Qu.:45049                      3rd Qu.:   72728   3rd Qu.:0.9368  
##  Max.   :56045                      Max.   :10098052   Max.   :1.3597  
##                                     NA's   :106        NA's   :71
ec|> 
  filter(str_detect(county_name, "Utah"))|>
  ggplot(mapping = aes(pop2018)) +
  geom_histogram(bins = 17, color = "white", fill = "darkolivegreen4") +
  labs(title = "Population in Utah Counties (2018)",
       x = "Population (2018)",
       y = "Count",
       subtitle = "Few counties above 100,000") + 
  scale_x_log10(breaks = c(1000, 10000, 100000, 1000000, 10000000), 
                labels = comma) +
  theme_bw()