Switch from I to we

Fixes #642
This commit is contained in:
Hadley Wickham
2022-08-09 11:43:12 -05:00
parent c6b1f501c2
commit 1d0902c9bf
22 changed files with 145 additions and 152 deletions

View File

@@ -15,7 +15,7 @@ R has several systems for making graphs, but ggplot2 is one of the most elegant
ggplot2 implements the **grammar of graphics**, a coherent system for describing and building graphs.
With ggplot2, you can do more faster by learning one system and applying it in many places.
If you'd like to learn more about the theoretical underpinnings of ggplot2, I recommend reading "The Layered Grammar of Graphics", <http://vita.had.co.nz/papers/layered-grammar.pdf>.
If you'd like to learn more about the theoretical underpinnings of ggplot2, you might enjoy reading "The Layered Grammar of Graphics", <http://vita.had.co.nz/papers/layered-grammar.pdf>, the scientific paper that discusses the theoretical underpinnings..
### Prerequisites
@@ -91,7 +91,7 @@ Does this confirm or refute your hypothesis about fuel efficiency and engine siz
With ggplot2, you begin a plot with the function `ggplot()`.
`ggplot()` creates a coordinate system that you can add layers to.
The first argument of `ggplot()` is the dataset to use in the graph.
So `ggplot(data = mpg)` creates an empty graph, but it's not very interesting so I'm not going to show it here.
So `ggplot(data = mpg)` creates an empty graph, but it's not very interesting so we won't show it here.
You complete your graph by adding one or more layers to `ggplot()`.
The function `geom_point()` adds a layer of points to your plot, which creates a scatterplot.
@@ -364,7 +364,7 @@ ggplot(shapes, aes(x, y)) +
As you start to run R code, you're likely to run into problems.
Don't worry --- it happens to everyone.
I have been writing R code for years, and every day I still write code that doesn't work!
We have all been writing R code for years, but every day we still write code that doesn't work!
Start by carefully comparing the code that you're running to the code in the book.
R is extremely picky, and a misplaced character can make all the difference.
@@ -728,7 +728,7 @@ ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) +
3. What does `show.legend = FALSE` do?
What happens if you remove it?\
Why do you think I used it earlier in the chapter?
Why do you think we used it earlier in the chapter?
4. What does the `se` argument to `geom_smooth()` do?
@@ -862,7 +862,7 @@ This means that you can typically use geoms without worrying about the underlyin
However, there are three reasons why you might need to use a stat explicitly:
1. You might want to override the default stat.
In the code below, I change the stat of `geom_bar()` from count (the default) to identity.
In the code below, we change the stat of `geom_bar()` from count (the default) to identity.
This lets me map the height of the bars to the raw values of a $y$ variable.
Unfortunately when people talk about bar charts casually, they might be referring to this type of bar chart, where the height of the bar is already present in the data, or the previous bar chart where the height of the bar is generated by counting rows.