自选国家
探索性数据分析的目的就是提出问题,并用数据来回答。现在轮到您来提问题了。
请挑选一些您感兴趣的国家,并把它们加入到图中。若想查看国家的完整列表,请在控制台输入 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")