read_tsv (“tab-separated values”), like read_csv.ais.txt:Depends on number and type of variables:
| Categorical | Quantitative | Graph |
|---|---|---|
| 1 | 0 | bar chart |
| 0 | 1 | histogram |
| 2 | 0 | grouped bar charts |
| 1 | 1 | side-by-side boxplots |
| 0 | 2 | scatterplot |
| 2 | 1 | grouped boxplots |
| 1 | 2 | scatterplot with points identified by group (eg. by colour) |
With more (categorical) variables, might want separate plots by groups. This is called facetting in R.
ggplotggplot, that we use for all our graphs.Grouped bar chart:
Scatterplot:
A variation that uses colour instead of fill:
Default uses same scale for each facet. To use different scales for each facet, this: