ハイライトの例(1)

#| code-line-numbers: "3"の場合

Country_df |>
  filter(Continent == "Europe") |>
  drop_na(PPP_per_capita) |>
  mutate(Country = fct_reorder(Country, PPP_per_capita)) |> 
  ggplot() +
  geom_segment(aes(y = Country, yend = Country,
                   x = 0, xend = PPP_per_capita)) +
  geom_point(aes(y = Country, x = PPP_per_capita), color = "orange") +
  labs(x = "一人あたり購買力平価GDP (USD)", y = "国") +
  theme_bw(base_size = 12)

ハイライトの例(2)

#| code-line-numbers: "2,3,4"の場合

Country_df |>
  filter(Continent == "Europe") |>
  drop_na(PPP_per_capita) |>
  mutate(Country = fct_reorder(Country, PPP_per_capita)) |> 
  ggplot() +
  geom_segment(aes(y = Country, yend = Country,
                   x = 0, xend = PPP_per_capita)) +
  geom_point(aes(y = Country, x = PPP_per_capita), color = "orange") +
  labs(x = "一人あたり購買力平価GDP (USD)", y = "国") +
  theme_bw(base_size = 12)

ハイライトの例(3)

#| code-line-numbers: "6-8,10"の場合

Country_df |>
  filter(Continent == "Europe") |>
  drop_na(PPP_per_capita) |>
  mutate(Country = fct_reorder(Country, PPP_per_capita)) |> 
  ggplot() +
  geom_segment(aes(y = Country, yend = Country,
                   x = 0, xend = PPP_per_capita)) +
  geom_point(aes(y = Country, x = PPP_per_capita), color = "orange") +
  labs(x = "一人あたり購買力平価GDP (USD)", y = "国") +
  theme_bw(base_size = 12)

ハイライトの例(4)

#| code-line-numbers: "|6-8|10"の場合

Country_df |>
  filter(Continent == "Europe") |>
  drop_na(PPP_per_capita) |>
  mutate(Country = fct_reorder(Country, PPP_per_capita)) |> 
  ggplot() +
  geom_segment(aes(y = Country, yend = Country,
                   x = 0, xend = PPP_per_capita)) +
  geom_point(aes(y = Country, x = PPP_per_capita), color = "orange") +
  labs(x = "一人あたり購買力平価GDP (USD)", y = "国") +
  theme_bw(base_size = 12)