R 中的可视化最佳实践
Nick Strayer
Instructor
你将学到
通过深入思考手头数据,制作更好的可视化。

学习方式
第 1 章:整体中的比例

第 2 章:点数据

第 3 章:单变量分布

第 4 章:多(或条件)分布


这些主题不如其他编程主题泾渭分明
每条规则都有例外
强调逐一思考问题,帮助你在遇到这些情况时处理它们
R
"Tidyverse"
Ggplot2
![]()


who_disease
# A tibble: 43,262 x 6
region countryCode country disease year cases
<chr> <chr> <chr> <chr> <int> <dbl>
1 EMR AFG Afghanistan measles 2016 638
2 EUR ALB Albania measles 2016 17.0
3 AFR DZA Algeria measles 2016 41.0
4 EUR AND Andorra measles 2016 0
5 AFR AGO Angola measles 2016 53.0
6 AMR ATG Antigua and Barbuda measles 2016 0
7 AMR ARG Argentina measles 2016 0
8 EUR ARM Armenia measles 2016 2.00
# ... with 43,254 more rows
# Filter to AMR region
amr_region <- who_disease %>%
filter(region == 'AMR')
# Map x to year and y to cases, color by disease
ggplot(amr_region, aes(x = year, y = cases, color = disease)) +
geom_point(alpha = 0.5)

R 中的可视化最佳实践