library(tidyverse)Warning: package 'ggplot2' was built under R version 4.3.3
Warning: package 'purrr' was built under R version 4.3.3
Warning: package 'lubridate' was built under R version 4.3.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.2 ✔ tibble 3.2.1
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.4
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
ti <- tibble(
country = c("United Kingdom", "Germany", "Ireland"),
ancestry = c(54000000, 45000000, 34000000)
)
ti |>
ggplot(aes(x = country, y = ancestry, fill = country)) +
geom_col() +
scale_fill_manual(values = c(
"United Kingdom" = "red",
"Germany" = "blue",
"Ireland" = "green"
)) +
labs(
title = "US Americans w/ European Ancestry (Top 3 Countries)",
x = "Country",
y = "Number of US Americans",
fill = "Country"
) +
scale_y_continuous(labels = scales::comma)