-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path40_data_visualization.Rmd
372 lines (154 loc) · 18.3 KB
/
40_data_visualization.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# (PART) Data Visualization {-}
# General {#datavisualization}
## Introduction
This is an _enormous_ topic.
But start here:
* Alberto Cairo, _The Functional Art_ [@Cairo_2013] and _The Truthful Art_ [@Cairo_2016] are framed in the context of Cairo's professional expertise in "data journalism".
-- Cairo's blog has a number of very good posts, including:
-- [Keep those legends ](http://www.thefunctionalart.com/2019/07/keep-those-legends.html) (2019-07-17)
* William S. Cleveland's books, _Visualizing Data_ [@Cleveland_1993] and _The Elements of Graphing Data_ [@Cleveland_1994], are classics in the field of statistical graphics.
* Kennedy Elliot, [Everything we know about how humans interpret graphics](https://www.youtube.com/watch?v=s0J6EDvlN30), video of talk given at OpenVis conference, 2016-04-25 & 26.
* Jill H. Larkin and Herbert A. Simon, "Why a diagram is (sometimes) worth ten thousand words", _Cognitive Science_, 1987 [@Larkin_Simon_1987]
* Elijah Meeks, ["What Charts Do"](https://medium.com/@Elijah_Meeks/what-charts-do-48ed96f70a74) (2018-05-21) is a succinct summary that's worth reading.
* Cole Nussbaumer Knaflic, _Storytelling with Data_ [@NussbaumerKnaflic_2015]. A great introduction to the fundamentals of good visualization. The [companion blog](https://www.storytellingwithdata.com/) has an on-going series of further dives into the topic.
* Naomi Robbins, _Creating More Effective Graphs_. [@Robbins_2013]
* Alan Smith, ["Data visualisation: it is not all about technology"](https://www.ft.com/content/aba6c58e-5a8e-11e7-9bc8-8055f264aa8b?accessToken=zwAAAVz0i_FYkdOrpsWOWo4R59ObyIBV8mSqiw.MEQCIFBdm394GSC6W-YIMME93SN8BgAuLEfyK8nFshbAiyu-AiBx6Qx4Ivd3qh-VSfIlwrf5tYKdnbGId1n0pzxZFUwDsQ&sharetype=gift), _Financial Times_, 2017-06-28
* John W. Tukey, _Exploratory Data Analysis_ [@Tukey_1977] is a classic--it might seem dated with its heavy reliance on analogue methods (for example, the suggestions about graph paper (p.127)), but the concepts are timeless.
## General resources
* F.J. Anscombe, "Graphs in Statistical Analysis" -- the classic paper that introduced the justifiably-famous [_Anscombe's Quartet_](https://en.wikipedia.org/wiki/Anscombe%27s_quartet) [@Anscombe_1973]
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">See, people think Anscombe's quartet is all artificial extreme cases and no one would actually make such a stupid mistake with regression, and then you get figures like Fig 8C <a href="https://t.co/LrPn1fjShp">https://t.co/LrPn1fjShp</a> <a href="https://t.co/sEG3BXpQYj">pic.twitter.com/sEG3BXpQYj</a></p>— Mark Baxter #ITMFA (@markgbaxter) <a href="https://twitter.com/markgbaxter/status/1224398295096877057?ref_src=twsrc%5Etfw">February 3, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
* [Enrico Bertini's homepage](http://enrico.bertini.io/) -- a plethora of articles and resources on data visualization
* [Data Visualization Inventors, Founders, and Developers](https://policyviz.com/2019/01/09/data-visualization-inventors-founders-and-developers/) -- credit where credit is due
* Richard Brath & Ebad Banissi, 2016, ["Using Typography to Expand the
Design Space of Data Visualization"](https://www.sciencedirect.com/science/article/pii/S2405872616300107), _She Ji: The Journal of Design, Economics, and Innovation_, Vol. 2, Issue 1, Spring 2016
* Karl Broman, [The top ten worst graphs](https://www.biostat.wisc.edu/~kbroman/topten_worstgraphs/)
* William Cleveland & Robert McGill, "Graphical Perception: Theory, Experimentation, and Application to the Development of Graphical Methods" [@Cleveland_and_McGill_1984]
* Keith Collins (2015-12-23), [The most misleading charts of 2015, fixed](https://qz.com/580859/the-most-misleading-charts-of-2015-fixed/); good discussion of problematic choices with axis scales.
* Datawrapper, [Chartable](https://blog.datawrapper.de/) -- blog including weekly charts and how-to advice
* [Financial Times Visual Vocabulary](https://github.com/ft-interactive/chart-doctor/tree/master/visual-vocabulary), "A poster (available in English, Japanese, traditional Chinese and simplified Chinese) and web site to assist designers and journalists to select the optimal symbology for data visualisations, by the Financial Times Visual Journalism Team."
* Steve Franconeri, [Chart Chooser](http://experception.net/)
- background: ["Multiple views on how to choose a visualization"](https://medium.com/multiple-views-visualization-research-explained/multiple-views-on-how-to-choose-a-visualization-b3ffc99fcddc), 2019-04-24, at medium.com
* Michael Friendly, [DataVis.ca](http://datavis.ca/) -- a variety of resources, including the "Milestones Project" (significant events in the history of data visualization), books, courses, papers, and R materials.
* Kieran Healy _Data Visualization: A practical introduction_. [@Healy_2019]
- [online version](http://socviz.co/)
* Kate Moran, 2017-08-06, ["How to Present Scientific Findings Online"](https://www.nngroup.com/articles/scientific-findings-online/) (file under: Know Your Audience)
* Tamara Munzer, [list and links to talks](http://www.cs.ubc.ca/~tmm/talks.html?utm_content=bufferd5cd8&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer#cj16)
* PolicyViz, [DataViz Cheatsheet](https://policyviz.com/2018/08/07/dataviz-cheatsheet/) (2018-08-07)
* Elizabeth Ricks, ["How do I know which graph to use?"](https://www.storytellingwithdata.com/blog/2021/4/6/how-do-i-know-which-graph-to-use)—blog article at storytellingwithdata.com
* Rougier NP, Droettboom M, Bourne PE (2014) "Ten Simple Rules for Better Figures". [@Rougier_etal_2014]
* Howard Wainer, "How to Display data Badly" [@Wainer_1984]
* Claus O. Wilke (2019, full draft) [_Fundamentals of Data Visualization_](http://serialmentor.com/dataviz/)
- Important: Wilke notes that this is a platform-agnostic book, but it was written in R's {bookdown} and uses {ggplot2} for all of the figures.
- [the github repo for the book](https://github.com/clauswilke/dataviz) (in case you want to plagiarize the code for a specific figure)
* Google, [_Data Visualization_](https://material.io/design/communication/data-visualization.html#), part of Google's [Material](https://material.io/)
- Mark Wilson, 2019-06-28, ["Google’s six rules for great data design"](https://www.fastcompany.com/90369607/googles-six-rules-for-great-data-design) (at FastCompany)
RJ Andrews, 2020-01-28, ["Illustration Invades Everything": Reflections by Minard on his graphical impact.](https://infowetrust.com/project/minard1861)
### Animation in Data Visualization
Jon Schwabish, 2019-08-06, [Observations on Animation in Data Visualization](https://policyviz.com/2019/08/06/observations-on-animation-in-data-visualization/)
### Data Visualization Society (Medium)
Medium's [Data Visualization Society](https://medium.com/data-visualization-society) "Data Visualization Society aims to collect and establish best practices, fostering a community that supports members as they grow and develop data visualization skills."
* Allen Hillery, 2019-05-06, [W.E.B Du Bois and Four Essential Steps to Effective Persuasion](https://medium.com/data-visualization-society/w-e-b-dubois-and-four-essential-steps-to-effective-persuasion-6108a70a5708?sk=467b19142f3bec315582ac4f100d9db6)
* Michael Correll (2018-11-20) [What Does “Visualization Literacy” Mean, Anyway?](https://medium.com/multiple-views-visualization-research-explained/what-does-visualization-literacy-mean-anyway-22f3b3badc0)
* Kennedy Elliot (2016-05-02) [39 studies about human perception in 30 minutes](https://medium.com/@kennelliott/39-studies-about-human-perception-in-30-minutes-4728f9e31a73)
***
## R Resources
### general
* [R Graph Catalog](http://shiny.stat.ubc.ca/r-graph-catalog/) -- an unbeatable resource for making good graphs in R, described by the creators as "a complement to _Creating More Effective Graphs_ by Naomi Robbins." [@Robbins_2013]
* [The R Graph Gallery](https://www.r-graph-gallery.com/)
* Michael Friendly and David Meyer (2016) _Discrete Data Analysis with R_ [@Friendly_Meyer_2016]
* Kieran Healy _Data Visualization: A practical introduction_. [@Healy_2019]
- [online version](http://socviz.co/)
* [Shiny apps for statistics](https://statistics.calpoly.edu/shiny) -- by the Statistics Department at CalPoly
### Packages
## `{ggplot2}` -- the pre-eminent way to create charts and graphs in R
* [{ggplot2}: part of the tidyverse](http://ggplot2.tidyverse.org/index.html) -- reference materials, examples, etc etc. Start here.
* Winston Chang, [_R Graphics Cookbook_, 2nd edition](https://r-graphics.org/)[@Chang_2018]
* [Top 50 {ggplot2} Visualizations - The Master List (With Full R Code)](http://r-statistics.co/Top50-Ggplot2-Visualizations-MasterList-R-Code.html)
* [A Compendium of Clean Graphs in R](http://shinyapps.org/apps/RGraphCompendium/index.php), by Eric-Jan Wagenmakers and Quentin F. Gronau
* [BBC Visual and Data Journalism cookbook for R graphics](https://bbc.github.io/rcookbook/)
- [{bbplot}](https://github.com/bbc/bbplot), a package with their templates etc.
- ["How the BBC Visual and Data Journalism team works with graphics in R"](https://medium.com/bbc-visual-and-data-journalism/how-the-bbc-visual-and-data-journalism-team-works-with-graphics-in-r-ed0b35693535)
* Gina Reynolds, 2019-01-31, [the ggplot flipbook](https://evamaerey.github.io/ggplot_flipbook/ggplot_flipbook_xaringan.html#1)
* Will Chase, 2019-05-29, [R you ready to make charts?](https://www.williamrchase.com/slides/ggplot_intro.html#64), Philly dataviz meetup
* Dana Paige Seidel, [Default ggplot2 aesthetics by geom](https://gist.github.com/dpseidel/57f28ccc034ccfdd0cf25b6c6c82a635)
* Henry Wang, [ggplot2 Theme Elements Demonstration](https://henrywang.nl/ggplot2-theme-elements-demonstration/)
* [{ggplot2}: A complete guide to scales](https://ggplot2tor.com/scales/) "There are numerous scales in ggplot2. Too many to memorize. This app makes it easy for you to find the right scales and arguments for your variable types and aesthetics."
### extensions
There are many extension packages that allow you to make other visualizations in {ggplot2}. Some are catalogued at [exts.ggplot2.tidyverse.org/](https://exts.ggplot2.tidyverse.org/).
* [Gallery of {ggplot2} extensions:](https://exts.ggplot2.tidyverse.org/gallery/)
#### `{ggfittext}`
"ggplot2 geoms to fit text into boxes"
* GitHub page: [wilkox/ggfittext](https://github.com/wilkox/ggfittext)
* Reference page: [ggfittext](https://wilkox.org/ggfittext/)
#### `{patchwork}` -- The Composer of Plots
"The goal of patchwork is to make it ridiculously simple to combine separate ggplots into the same graphic."
* [CRAN page](https://cloud.r-project.org/package=patchwork)
* [Reference page](https://patchwork.data-imaginist.com/)
#### `{see}` -- Model Visualization Toolbox for 'easystats` and 'ggplot2`
* [Reference page](see: Model Visualisation Toolbox for ‘easystats’ and ‘ggplot2’)
### themes
{ggplot2} has a number of [themes in the core package](https://ggplot2.tidyverse.org/reference/ggtheme.html), and here are some to extend the range:
* [ggthemes](https://yutannihilation.github.io/allYourFigureAreBelongToUs/ggthemes/) -- includes various publications (e.g. Wall Street Journal, Economist), software (e.g. Excel, Stata), dataviz celebrities (e.g. Tufte, Few), and others
* [ggpomological: A Pomological ggplot2 Theme](https://www.garrickadenbuie.com/project/ggpomological/)
### tips and tricks
* Simon Jackson, 2016-08-11, [Plotting background data for groups with {ggplot2}](https://drsimonj.svbtle.com/plotting-background-data-for-groups-with-ggplot2)
* Laura Ellis, 2018-08-01, [Highlighting with {ggplot2}: The Old School and New School Way](https://www.littlemissdata.com/blog/highlight)
* Sharon Machlis, 2019-07-24, [How to write your own ggplot2 functions in R](https://www.infoworld.com/article/3410295/how-to-write-your-own-ggplot2-functions-in-r.html)
* Isabella R. Ghement, 2020-05-18, [twitter thread](https://twitter.com/IsabellaGhement/status/1262450736354390016?s=20) that shows step-by-step how to build and customize scatterplots in R.
***
## Plotly
Plotly for R allows you to "Create interactive, D3 and WebGL charts in R" (their words, not mine). A great resource for upping the content of online visualizations.
* Carson Sievert, [_Plotly for R_](http://plotly-book.cpsievert.me/)
***
## Colour
Colour is a vital part of good data visualization.
### General resources
Lisa Charlotte Rost, 2018-07-31, [Your Friendly Guide to Colors in Data Visualisation](https://blog.datawrapper.de/colorguide/) -- An overview of color tools
Lisa Charlotte Rost, 2020-09-04, [How to pick more beautiful colors for your data visualizations: Common color mistakes and how to avoid them](https://blog.datawrapper.de/beautifulcolors/)
#### General resources: R
The following links support the use of colour in R.
* [R color cheatsheet](https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/colorPaletteCheatsheet.pdf)
### colour (or color) blindness
* Masataka Okabe and Kei Ito, 2008-09-24, [Color Universal Design (CUD) - How to make figures and presentations that are friendly to Colorblind people](https://jfly.uni-koeln.de/color/)
* Tom Jager (2018-06-25) [How to Optimize Charts For Color Blind Readers Using Color Blind Friendly Palettes](https://venngage.com/blog/color-blind-friendly-palette/)
* Natalie Houston, ["Creating Color-Blind Accessible Figures"](https://www.reed.edu/economics/parker/311/Creating-Color-Blind-Accessible-Figures-ProfHacker---Blogs---The-Chronicle-of-Higher-Education.pdf), _ProfHacker_, _The Chronicle of Higher Education_, 2015-02-09
#### R packages to address colour blindness
{ggokabeito}: 'Okabe-Ito' Scales for 'ggplot2' and 'ggraph'
* "ggokabeito provides ggplot2 and ggraph scales to easily use the discrete, colorblind-friendly ‘Okabe-Ito’ palette in your data visualizations"
* [{ggokabeito} reference page](https://malcolmbarrett.github.io/ggokabeito/)
* [CRAN page](https://CRAN.R-project.org/package=ggokabeito)
functions in the {see} package:
* [Okabe-Ito color palette](https://easystats.github.io/see/reference/scale_color_okabeito.html)
{colorblindr}: An R package to simulate colorblindness on R figures.
* [github repo](https://github.com/clauswilke/colorblindr)
* [Graphical User Interface to Check Images for Color Constraints](http://hclwizard.org:3000/cvdemulator/)
### `{colorspace}`
"A Toolbox for Manipulating and Assessing Colors and Palettes"
* [{colorspace} homepage](http://colorspace.r-forge.r-project.org/)
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">Looking forward to my <a href="https://twitter.com/UseR2019_Conf?ref_src=twsrc%5Etfw">@UseR2019_Conf</a> presentation about color palettes with <a href="https://twitter.com/hashtag/rstats?src=hash&ref_src=twsrc%5Etfw">#rstats</a> pkg <a href="https://twitter.com/hashtag/colorspace?src=hash&ref_src=twsrc%5Etfw">#colorspace</a> <a href="https://twitter.com/hashtag/dataviz?src=hash&ref_src=twsrc%5Etfw">#dataviz</a> <a href="https://twitter.com/hashtag/useR2019?src=hash&ref_src=twsrc%5Etfw">#useR2019</a> <a href="https://twitter.com/hashtag/endrainbow?src=hash&ref_src=twsrc%5Etfw">#endrainbow</a><br><br>When: 14:00<br>Where: Saint-Exupéry<br><br>Web: <a href="https://t.co/pdjmkYiDkV">https://t.co/pdjmkYiDkV</a><br>Interactive apps: <a href="https://t.co/YFC7gjKCKT">https://t.co/YFC7gjKCKT</a><br>Slides: <a href="https://t.co/KOiC1NmrMF">https://t.co/KOiC1NmrMF</a> <a href="https://t.co/cPF9ZF8Cl1">pic.twitter.com/cPF9ZF8Cl1</a></p>— Achim Zeileis (@AchimZeileis) <a href="https://twitter.com/AchimZeileis/status/1149239509751672832?ref_src=twsrc%5Etfw">July 11, 2019</a></blockquote>
### `{prismatic}`
[{prismatic reference site}](https://emilhvitfeldt.github.io/prismatic/)
### `{fishualize}`
GitHub: [fishualize: Color Palettes Based on Fish Species](https://nschiett.github.io/fishualize/index.html)
### ColorBrewer
The ColorBrewer palettes were designed by Dr. Cythia Brewer -- a variety of palettes designed for data visualization (including maps)
[ColorBrewer 2.0](http://colorbrewer2.org/#type=sequential&scheme=BuGn&n=3) -- tool for selecting colour schemes (centred on maps, but they work just as well for other forms of data visualization)
Cynthia A. Brewer (2003). A Transition in Improving Maps: The ColorBrewer Example. Cartography and Geographic Information Science [@Brewer_2003]
Cynthia A. Brewer, Geoffrey W. Hatchard, and Mark A. Harrower (2003) ColorBrewer in Print: A Catalog of Color Schemes for Maps, Cartography and Geographic Information Science [@Brewer_etal_2003].
#### the R package `{RColorBrewer}`
* [RColorBrewer's Palettes](https://www.r-graph-gallery.com/38-rcolorbrewers-palettes/) from The R Graph Gallery
* Stewart MacArthur, 2010-12-08, ["R: Using RColorBrewer to colour your figures in R"](https://www.r-bloggers.com/r-using-rcolorbrewer-to-colour-your-figures-in-r/)
### other colour notes and guides
* Alberto Cairo, 2019-06-26, ["Our understanding of rainbow colour schemes remains incomplete"](http://www.thefunctionalart.com/2019/06/our-understanding-of-rainbow-color.html)
* Robert Simmon, ["Use of Color in Data Visualization"](https://earthobservatory.nasa.gov/resources/blogs/intro_to_color_for_visualization.pdf) {pdf}
* Alan Wilson, 2017-02-27, ["The Power of The Palette: Why Color is Key in Data Visualization and How to Use It"](https://theblog.adobe.com/the-power-of-the-palette-why-color-is-key-in-data-visualization-and-how-to-use-it/) at Adobe Blog
### palettes in R
[{paletteer}](https://emilhvitfeldt.github.io/paletteer/)
* "a comprehensive collection of color palettes in R using a common interface. Think of it as the “caret of palettes”."
[{MetBrewer}](https://github.com/BlakeRMills/MetBrewer)
* "Color palette package in R inspired by works at the Metropolitan Museum of Art in New York" by [BlakeRMills](https://github.com/BlakeRMills)
Other palette resources:
* Clay Ford, 2016-06-10, ["Setting up Color Palettes in R"](https://data.library.virginia.edu/setting-up-color-palettes-in-r/)
* Joachim Goedhart, 2019-08-29, [Data Visualization with Flying Colors](https://thenode.biologists.com/data-visualization-with-flying-colors/research/), at thenode.biologists.com
* [R color cheatsheet](https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/colorPaletteCheatsheet.pdf)
-30-