Fixes typos in visualization.Rmd
This commit is contained in:
parent
e2fcf4928d
commit
81dc7a77e0
|
@ -17,7 +17,7 @@ This chapter focusses on ggplot2, one of the core members of the tidyverse. To a
|
|||
library(tidyverse)
|
||||
```
|
||||
|
||||
That one line of code loads the core tidyverse; packages which you will use in almost every data analysis. It also tells you which functions from the tidyverse conflicts with functions in base R (or from other packages you might have loaded).
|
||||
That one line of code loads the core tidyverse; packages which you will use in almost every data analysis. It also tells you which functions from the tidyverse conflict with functions in base R (or from other packages you might have loaded).
|
||||
|
||||
If you run this code and get the error message "there is no package called ‘tidyverse’", you'll need to first install it, then run `library()` once again.
|
||||
|
||||
|
@ -154,9 +154,9 @@ ggplot(data = mpg) +
|
|||
geom_point(mapping = aes(x = displ, y = hwy, shape = class))
|
||||
```
|
||||
|
||||
What happened to the SUVs? ggplot2 will only use six shapes at a time. By default, additional groups will go unplotted when you use this aesthetic.
|
||||
What happened to the SUVs? ggplot2 will only use six shapes at a time. By default, additional groups will go unplotted when you use the shape aesthetic.
|
||||
|
||||
For each aesthetic, you use the `aes()` associate the name of the aesthetic with a variable to display. The `aes()` function gathers together each of the aesthetic mappings used by a layer and passes them to the layer's mapping argument. The syntax highlights a useful insight about `x` and `y`: the x and y locations of a point are themselves aesthetics, visual properties that you can map to variables to display information about the data.
|
||||
For each aesthetic, you use `aes()` to associate the name of the aesthetic with a variable to display. The `aes()` function gathers together each of the aesthetic mappings used by a layer and passes them to the layer's mapping argument. The syntax highlights a useful insight about `x` and `y`: the x and y locations of a point are themselves aesthetics, visual properties that you can map to variables to display information about the data.
|
||||
|
||||
Once you map an aesthetic, ggplot2 takes care of the rest. It selects a reasonable scale to use with the aesthetic, and it constructs a legend that explains the mapping between levels and values. For x and y aesthetics, ggplot2 does not create a legend, but it creates an axis line with tick marks and a label. The axis line acts as a legend; it explains the mapping between locations and values.
|
||||
|
||||
|
@ -359,8 +359,7 @@ ggplot(data = mpg) +
|
|||
|
||||
ggplot(data = mpg) +
|
||||
geom_smooth(
|
||||
mapping = aes(x = displ, y = hwy, colour = drv),
|
||||
show.legend = FALSE
|
||||
mapping = aes(x = displ, y = hwy, group = drv)
|
||||
)
|
||||
```
|
||||
|
||||
|
@ -470,7 +469,7 @@ On the x-axis, the chart displays `cut`, a variable from `diamonds`. On the y-ax
|
|||
* smoothers fit a model to your data and then plot predictions from the
|
||||
model.
|
||||
|
||||
* boxplots compute a robust summary of the distribution and display as
|
||||
* boxplots compute a robust summary of the distribution and then display a
|
||||
specially formatted box.
|
||||
|
||||
The algorithm used to calculate new values for a graph is called a __stat__, short for statistical transformation. The figure below describes how this process works with `geom_bar()`.
|
||||
|
|
Loading…
Reference in New Issue