Today:

- Scatterplot AKA bivariate plot
- Linegraph
- Boxplot
- Histogram
**Barplot AKA barchart AKA bargraph**

Mon Oct 10, 2016

Today:

- Scatterplot AKA bivariate plot
- Linegraph
- Boxplot
- Histogram
**Barplot AKA barchart AKA bargraph**

Say we have the following piecharts represent the polling from a local election with five candidates (1-5) at three different time points A, B, an C:

Answer the following questions:

- In the first race, is candidate 5 doing better than candidate 4?
- Who did better between time A and time B, candidate 2 or candidate 4?

- Barplots display information about a single
**categorical**variable as the`x`

aesthetic. - The y-axis displays notions of
**relative frequency**i.e. which values occur more than others. - This is not an
**explicit**variable in the data set, but rather is either- Computed internally
- Computed manually by yourself

`geom_bar()`

is the trickiest of the 5NG in`ggplot2`

, hence me presenting it last- Correspondingly, we'll use it in limited capacity in this class and no need to open can of worms.
- If, however, you are feeling adventurous and want to open the can, feel free to ask me anyway!

Recall from Lec05 Slide 16, we displayed

There are two different ways to input the data:

- Where the counts
**are not**pre-computed (today) - Where the counts
**are**pre-computed

Counts **are not** pre-computed:

Row Number | name |
---|---|

1 | Albert |

2 | Albert |

3 | Albert |

4 | Virginia |

5 | Virginia |

Counts **are** pre-computed in variable `n`

. So `n`

becomes a `y`

aesthetic variable!

name | n |
---|---|

Albert | 3 |

Virginia | 2 |