自己挑選國家
探索性資料分析的目的,是提出問題並用資料來回答。現在換你來發問。
你將挑選幾個你有興趣的國家,並把它們加到圖上。如果想查完整的國家清單,請在主控台輸入 by_country$country。
本練習屬於課程
案例研究:R 中的探索性資料分析
練習說明
在 countries 向量中再加入「三個」國家,讓它們出現在分面圖中。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Add three more countries to this list
countries <- c("United States", "United Kingdom",
"France", "Japan", "Brazil", "India")
# Filtered by_year_country: filtered_countries
filtered_countries <- by_year_country %>%
filter(country %in% countries)
# Line plot of % yes over time faceted by country
ggplot(filtered_countries, aes(year, percent_yes)) +
geom_line() +
facet_wrap(~ country, scales = "free_y")