In class example

with an introduction to Quarto

Author

Cullen Ryle

Intro

(This dataset includes statistics from 2022 related to immigration trends in Europe. By analyzing these trends, we can identify shifts in economic, political, and cultural factors that may have influenced migration patterns. These insights provide a broader perspective on potential future developments, helping us gauge possible trends and anticipate changes in the coming years.

https://www.kaggle.com/datasets/umarzafar/immigration-trends-and-population-in-europe”)

euroimm <- read_csv("https://myxavier-my.sharepoint.com/:x:/g/personal/rylec_xavier_edu/EexNqLPzle9Agt5DG9CuPRwBbvmBZhIZEgbeoJIPe9PgTQ?download=1")

Research Question

How does the number of immigrants per thousand residents vary across different EU countries, and what factors might explain these differences?

euroimm %>%
  filter(`EU COUNTRIES` %in% c(`EU COUNTRIES`)) %>%
  ggplot(aes(
    x = `IMMIGRANTS WITH NATIONALITY(THOUSANDS)`, 
    y = `TOTAL IMMIGRANTS(IN THOUSANDS)`, 
    color = `EU COUNTRIES` 
  )) +
  geom_point(size = 3, alpha = 0.7) + 
  geom_smooth(method = "lm", se = FALSE) + 
  labs(
    title = "Immigrants per Thousand vs. Nationality Percentage",
    x = "Percentage of Immigrants with Nationality",
    y = "Immigrants per Thousand Residents",
    color = "EU Country"
  ) +
  theme_minimal()

Code Explanation

The first part of the code for the scatter chart sets the X(Percentage of Immigrants with Nationality) and Y(Immigrants per Thousand Residents) variables so we are able to visualize the variables against each other for each country, while the color is to denote countries in the EU.