fixed 3 minor typos (#172)

* Fixed typo in visualize

* fix typo

* fix typo
This commit is contained in:
robinsones 2016-07-23 09:59:53 -04:00 committed by Hadley Wickham
parent 45d2353262
commit e86c443320
1 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ ggplot(data = mpg) +
To map an aesthetic to a variable, set the name of the aesthetic to the name of the variable inside `aes()`. ggplot2 will automatically assign a unique level of the aesthetic (here a unique color) to each unique value of the variable, a process known as __scaling__. ggplot2 will also add a legend that explains which levels correspond to which values.
The colors reveal that many of the unusual points are two seater cars. These cars aren't seem like hybrids, and are, in fact, sports cars! Sports cars have large engines like SUVs and pickup trucks, but small bodies like midsize and compact cars, which improves their gas mileage. In hindsight, these cars were unlikely to be hybrids since they have large engines.
The colors reveal that many of the unusual points are two seater cars. These cars don't seem like hybrids, and are, in fact, sports cars! Sports cars have large engines like SUVs and pickup trucks, but small bodies like midsize and compact cars, which improves their gas mileage. In hindsight, these cars were unlikely to be hybrids since they have large engines.
In the above example, we mapped `class` to the color aesthetic, but we could have mapped `class` to the size aesthetic in the same way. In this case, the exact size of each point would reveal its class affiliation. We get a _warning_ here, because mapping an unordered variable (`class`) to an ordered aesthetic (`size`) is not a good idea.
@ -229,9 +229,9 @@ ggplot(data = mpg)
+ geom_point(mapping = aes(x = displ, y = hwy))
```
If you're still stuck, try the help. You can get help about any R function or by runnning `?function_name` in the console, or selecting the function name and pressing F1 in RStudio. Don't worry if the help doesn't seem that helpful - instead skip down to the examples and look for code that matches what you're trying to do.
If you're still stuck, try the help. You can get help about any R function by runnning `?function_name` in the console, or selecting the function name and pressing F1 in RStudio. Don't worry if the help doesn't seem that helpful - instead skip down to the examples and look for code that matches what you're trying to do.
If that doesn't help, carefully read the error message. Sometimes the answer will be buried there! But when you're new to R, the answer might be but you don't yet know how to understand it. Another great tool is google: trying googling the error message, as it's likely someone else has had the same problem, and have gotten help on line.
If that doesn't help, carefully read the error message. Sometimes the answer will be buried there! But when you're new to R, the answer might be but you don't yet know how to understand it. Another great tool is google: trying googling the error message, as it's likely someone else has had the same problem, and have gotten help online.
## Facets