Skip to content

Commit

Permalink
Fix typos, closes hadley#1537
Browse files Browse the repository at this point in the history
  • Loading branch information
mine-cetinkaya-rundel authored Oct 30, 2023
1 parent c97f69d commit 79fb949
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data-visualize.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ We can use stacked bar plots to visualize the relationship between two categoric
For example, the following two stacked bar plots both display the relationship between `island` and `species`, or specifically, visualizing the distribution of `species` within each island.

The first plot shows the frequencies of each species of penguins on each island.
The plot of frequencies show that there are equal numbers of Adelies on each island.
The plot of frequencies shows that there are equal numbers of Adelies on each island.
But we don't have a good sense of the percentage balance within each island.

```{r}
Expand All @@ -710,7 +710,7 @@ ggplot(penguins, aes(x = island, fill = species)) +
geom_bar()
```

The second plot is a relative frequency plot, created by setting `position = "fill"` in the geom is more useful for comparing species distributions across islands since it's not affected by the unequal numbers of penguins across the islands.
The second plot, a relative frequency plot created by setting `position = "fill"` in the geom, is more useful for comparing species distributions across islands since it's not affected by the unequal numbers of penguins across the islands.
Using this plot we can see that Gentoo penguins all live on Biscoe island and make up roughly 75% of the penguins on that island, Chinstrap all live on Dream island and make up roughly 50% of the penguins on that island, and Adelie live on all three islands and make up all of the penguins on Torgersen.

```{r}
Expand Down

0 comments on commit 79fb949

Please sign in to comment.