From 5f16562857e22b44baea20e389b1de7644b8f081 Mon Sep 17 00:00:00 2001 From: S'busiso Mkhondwane Date: Tue, 30 Aug 2016 00:34:01 +0200 Subject: [PATCH] Update communicate-plots.Rmd (#327) Typos and somewhere in the chapter you this line "You can use labels in the same way (a character vector the same length as breaks),..." I think you are missing a word "...(a character vector "use" the same length as breaks)" --- communicate-plots.Rmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/communicate-plots.Rmd b/communicate-plots.Rmd index 0221264..7713b1e 100644 --- a/communicate-plots.Rmd +++ b/communicate-plots.Rmd @@ -78,7 +78,7 @@ ggplot(df, aes(x, y)) + ### Exercises -1. Create one plot of the fuel economy data with customized `title`, +1. Create one plot on the fuel economy data with customised `title`, `subtitle`, `caption`, `x`, `y`, and `colour` labels. 1. The `geom_smooth()` is somewhat misleading because the `hwy` for @@ -221,7 +221,7 @@ The only limit is your imagination (and your patience with positioning annotatio ### Exercises -1. Use `geom_text()` with infinite positions to place text at of the +1. Use `geom_text()` with infinite positions to place text at the four corners of the plot. 1. Read the documentation for `annotate()`. How can you use it to add a text @@ -287,7 +287,7 @@ ggplot(mpg, aes(displ, hwy)) + scale_y_continuous(labels = NULL) ``` -You can also use `breaks` and `labels` to control the appearance of legends. Collectively axes and legends are called __guides__. Axes are used for x and y aesthetics; legends are used used for everything else. +You can also use `breaks` and `labels` to control the appearance of legends. Collectively axes and legends are called __guides__. Axes are used for x and y aesthetics; legends are used for everything else. Another use of `breaks` is when you have relatively few data points and want to highlight exactly where the observations occur. For example, take this plot that shows when each US president started and ended their term. @@ -484,7 +484,7 @@ In this particular case, you could have simply used faceting, but this technique ## Themes -Finally, you can customize the non-data elements of your plot with a theme: +Finally, you can customise the non-data elements of your plot with a theme: ```{r, message = FALSE} ggplot(mpg, aes(displ, hwy)) + @@ -521,7 +521,7 @@ Generally, however, I think you should be assembling your final reports using R ### Figure sizing -The biggest challenge of graphics in RMarkdown is getting your figures the right size and shape. There are five main options that control figure sizing: `fig.width`, `fig.height`, `fig.asp`, `out.width` and `out.height`. Image sizing is challenging because there are two sizes (the size of the figure created by R and the size at which it is inserted in the output document), and multiple ways of specifying the size (i.e., height, width, and aspect ratio: pick two of three). +The biggest challenge of graphics in R Markdown is getting your figures the right size and shape. There are five main options that control figure sizing: `fig.width`, `fig.height`, `fig.asp`, `out.width` and `out.height`. Image sizing is challenging because there are two sizes (the size of the figure created by R and the size at which it is inserted in the output document), and multiple ways of specifying the size (i.e., height, width, and aspect ratio: pick two of three). I only ever use three of the five options: