Chapter 20 Show only certain countries?

To choose only certain countries to plot, use the parameter select_countries. If you are creating a plot with a calculate_ function, this parameter is in calculate_ function. If the plot only uses the plot_ function, this parameter is in the plot_ function. The parameters is called select_countries in both cases.

20.1 Plots that go with calculate_ functions

survey1 %>%
  calculate_smry_comp("Q1COVID19",
                      select_countries = c("Morocco","Lebanon")) %>%
  
  plot_smry_comp(.caption = "Arab Barometer Wave VI, Survey I")

20.2 Plots with no calculate_ functions

df_list <- list(
  survey1,
  survey2,
  survey3
)

survey_dates <- c("Survey 1",
                  "Suvey 2",
                  "Survey 3")


plot_trend_comp("Q1COVID19",
                df_list,
                survey_dates,
                select_countries = c("Morocco",
                                     "Lebanon"))