Skip to content

Commit

Permalink
added better barplot discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorcampbell committed Nov 11, 2023
1 parent bc659ef commit cc7d936
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions source/viz.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -895,10 +895,13 @@ islands_df
Here, we have a data frame of Earth's landmasses,
and are trying to compare their sizes.
The right type of visualization to answer this question is a bar plot.
In a bar plot, the height of the bar represents the value of a summary statistic
(usually a size, count, proportion or percentage).
They are particularly useful for comparing summary statistics between different
groups of a categorical variable.
In a bar plot, the height of each bar represents the value of an *amount*
(a size, count, proportion, percentage, etc).
They are particularly useful for comparing counts or proportions across different
groups of a categorical variable. Note, however, that bar plots should generally not be
used to display mean or median values, as they hide important information about
the variation of the data. Instead it's better to show the distribution of
all the individual data points, e.g., using a histogram, which we will discuss further in Section \@ref(histogramsviz).

We specify that we would like to use a bar plot
via the `geom_bar` function in `ggplot2`.
Expand Down Expand Up @@ -995,7 +998,7 @@ visualization for answering our original questions. Landmasses are organized by
their size, and continents are colored differently than other landmasses,
making it quite clear that continents are the largest seven landmasses.

### Histograms: the Michelson speed of light data set
### Histograms: the Michelson speed of light data set {#histogramsviz}
The `morley` data set \index{Michelson speed of light}
contains measurements of the speed of light
collected in experiments performed in 1879.
Expand Down

0 comments on commit cc7d936

Please sign in to comment.