[OC] Über 50 Jahre Einwanderung nach Kanada

    Von hswerdfe_2

    11 Comments

    1. hswerdfe_2 on

      R code to reproduce

      library(cansim)
      library(tidyverse)
      library(ggplot2)
      library(janitor)
      library(lubridate)
      library(glue)

      df_raw <-
      cansim::get_cansim(’17-10-0008′) |>
      janitor::clean_names()

      pop_raw <-
      cansim::get_cansim(’17-10-0009′) |>
      janitor::clean_names()

      dat <-
      df_raw |>
      filter(geo == ‘Canada’ &
      (components_of_population_growth == ‘Net non-permanent residents’ |
      components_of_population_growth == ‘Immigrants’)
      ) |>
      separate(col = ref_date, sep = ‘/’, into = c(‘year_start’, ‘year_end’), convert = TRUE, remove = FALSE) |>
      select(ref_date, year_start, components_of_population_growth, value) |>
      summarise(value = sum(value), .by = c(‘ref_date’ , ‘year_start’)) |>
      mutate(components_of_population_growth = ‘Immigrants + Net non-permanent’)

      pop <-
      pop_raw |>
      filter(geo == ‘Canada’
      ) |>
      separate(col = ref_date, sep = ‘-‘, into = c(‘year’, ‘mon’), convert = TRUE) |>
      filter(mon == ‘4’) |>
      select(year, value) |>
      rename(pop := value)

      p_dat <-
      inner_join(
      pop,
      dat,
      by = join_by(year == year_start)
      ) |>
      mutate(f = value/pop, p = f*100)

      ##################
      # Results from Wikipedia
      elections <-
      read.csv(text = c(‘year, gov, leader
      2021, Liberal, J. Trudeau
      2019, Liberal, J. Trudeau
      2015, Liberal, J. Trudeau
      2011, Conservative, Harper
      2008, Conservative, Harper
      2006, Conservative, Harper
      2004, Liberal, Martin
      2000, Liberal, Chrétien
      1997, Liberal, Chrétien
      1993, Liberal, Chrétien
      1988, Conservative, Mulroney
      1984, Conservative, Mulroney
      1980, Liberal, P. Trudeau
      1979, Conservative, Clark
      1974, Liberal, P. Trudeau
      1972, Liberal, P. Trudeau
      1968, Liberal, P. Trudeau’)) |>
      tibble() |>
      mutate_if(is.character, trimws)

      govs <-
      p_dat |>
      distinct(year) |>
      full_join(elections, by = ‘year’) |>
      arrange(year) |>
      fill(gov , .direction = “down”) |>
      fill(leader , .direction = “down”)

      color_mapping = c(‘Liberal’ = ‘darkred’, ‘Conservative’ = ‘darkblue’)

      leaders <-
      p_dat |>
      left_join(govs, by = ‘year’) |>
      summarise(p = max(p) + 0.3,
      year = mean(range(year)), .by = c(leader, gov)
      )

      library(scales)

      yrs_rng <- paste0(range(p_dat$year), collapse = ‘-‘)

      p_dat |>
      left_join(govs, by = ‘year’) |>
      ggplot(aes(x = year, y = p)) +
      geom_line(aes(group = components_of_population_growth, fill = gov, color = gov ), size = 1.1, color = ‘grey’, linetype = ‘dashed’ ) +
      geom_point(aes(color = gov, size = 1.1)) +
      geom_text(data = leaders, mapping = aes(label = leader, color = gov), size = 6) +
      scale_color_manual(values = color_mapping ) +
      scale_fill_manual(values = color_mapping ) +
      scale_y_continuous(labels = function(x) paste0(x, “%”)) +
      #facet_grid(rows = ~components_of_population_growth) +
      guides(color = ‘none’, size = ‘none’, fill = ‘none’) +
      labs(title = glue(’50+ years of Immigration in Canada {yrs_rng}’) , subtitle = ‘Immigrants + Net non-permanent residents, as a percentage of the population.’, x = ”, y = ”, caption = ‘CanSim : 17-10-0008 & 17-10-0009’) +
      theme_minimal() +
      theme(
      plot.title = element_text(hjust = 0.5, size = 20),
      plot.subtitle = element_text(hjust = 0.5, size = 15, color = ‘grey’),
      axis.text = element_text(size = 18)
      )

    2. Still shows how little a % of the total population these non-permanent residents are across Canada. The perfect scapegoat though. Look at how high that graph peaked!

    3. freddy_guy on

      Excellent! Data suggests that immigration is a significant benefit to developed nations, so this is good news for Canada.

    4. Colonelfudgenustard on

      One starts to understand the Fuck Trudeau crowd a little bit better, even if the other options don’t offer any hope either.

    5. NeonBlueHair on

      This is a good example of accurate yet misleading data visualization. Immigration has spiked across a ton of countries as a result of a spike in regional conflicts and climate disasters causing refugees. Even in Trudeau’s time it was stable for the first 6 years (one of them due to the pandemic) then it spiked. But when you overlay it with PM names like you did, it misleads into it being a deliberate act by him

    6. With a birth rate of 1.43 per woman, Canada’s population will start to go down fast, and immigration is one way to try and boost your workforce

    7. Im_so_gone on

      For further reading, check out the “Century Initiative”. Some scary stuff if our infrastructure remains on the back burner, which you can see shades of in smaller towns (in Ontario at least) that are expanding quickly.

      Bring in the people, but schools, roads, parks, rec centres, telecomms, etc.. are lagging too far behind to support the amount of people, which is only causing tension between those who have lived in these towns for years, against those moving in from cities.

    8. kingofwale on

      Who knew bringing in people in unchecked and in massive quantity would create havoc in all aspect of Canadian lives. House price sky rocking, people can’t afford rent, food… national debt doubled in a couple of years….

      At least the current government is finally hearing it from the people. Good bye Trudeau.

    Leave A Reply