Data Computing
June 21, 2016
In its original sense, in archeology, a glyph is a carved symbol.
Heiroglyph | Mayan glyph |
---|---|
The features of a data glyph encodes the value of variables.
Aesthetics are visual properties of a glyph.
## Warning: Using size for a discrete variable is not advised.
sex -> color
color is black
The relationship between the variable value and the value of the aesthetic the variable is mapped to.
The conversion from SBP to position is a scale.
The conversion from Smoker to color is a scale.
—————————-|————————— |
sbp
and sex
sex
Graphics are designed by the human expert (you!) in order to reveal information that’s latent in the data.
More details, …, e.g. setting of aesthetics to constants
Remember …
Graphics are designed by the human expert (you!) in order to reveal information that’s latent in the data.
Your choices depend on what information you want to reveal and convey.
Learn by reading graphics and determining which ways of arranging thing are better or worse.
A basic principle is that a graphic is about comparison. Good graphics make it easy for people to perceive things that are similar and things that are different. Good graphics put the things to be compared “side-by-side”, that is, in perceptual proximity to one another.
In roughly descending order of human ability to compare nearby objects:
Color is the most difficult, because it is a 3-dimensional quantity.
- color gradients — we’re good at - discrete colors — must be carefully selected.
## Warning: Using size for a discrete variable is not advised.
Glyph-ready data has this form:
Glyph-ready data
## sbp dbp sex smoker
## 1 129 75 male never
## 2 105 62 female never
## 3 122 72 male never
## 4 128 83 female former
## 5 123 90 male former
## 6 122 77 male current
Mapping of data to aesthetics
sbp -> x
dbp -> y
smoker -> color
sex -> shape
Scales determine details of
data -> aesthetic
translation
Each layer may have its own data, glyphs, aesthetic mapping, etc.
## sbp dbp sex smoker
## 1 129 75 male never
## 2 105 62 female never
## 3 122 72 male never
## 4 128 83 female former
Eye-training
Data wrangling
dplyr
, tidyr
)Graphics construction
scatterGraphHelper()
, barGraphHelper()
, densityGraphHelper()
ggplot2