From 5b046924ef11fcfab32d638a19d757682e670be2 Mon Sep 17 00:00:00 2001 From: Julia Stewart Lowndes Date: Sun, 22 May 2016 11:45:14 -0700 Subject: [PATCH] fix 2 tiny typos --- visualize.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visualize.Rmd b/visualize.Rmd index f8c2309..d2004ca 100644 --- a/visualize.Rmd +++ b/visualize.Rmd @@ -493,7 +493,7 @@ You can learn which stat a geom uses, as well as what variables it computes by v Stats are the most subtle part of plotting because you do not see them in action. `ggplot2` applies the transformation and stores the results behind the scenes. You only see the finished plot. Moreover, `ggplot2` applies stats automatically, with a very intuitive set of defaults. As a result, you rarely need to adjust a geom's stat. However, you can do three things with a geom's stat if you wish to. -First, you can change the stat that the geom uses with the geom's stat argument. In the code below, I change the stat of `geom_bar()` from count (the default) to identity. This let's me map the height of the bars to the raw values of a $y$ variable. +First, you can change the stat that the geom uses with the geom's stat argument. In the code below, I 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. ```{r} demo <- data.frame( @@ -507,7 +507,7 @@ ggplot(data = demo) + demo ``` -I provide a list of the stats that are availalbe to use in ggplot2 at the end of this section. Be careful when you change a geom's stat. Many combinations of geoms and stats will create incompatible results. In practice, you will almost always use a geom's default stat. +I provide a list of the stats that are available to use in ggplot2 at the end of this section. Be careful when you change a geom's stat. Many combinations of geoms and stats will create incompatible results. In practice, you will almost always use a geom's default stat. Second, you can give some stats arguments by passing the arguments to your geom function. In the code below, I pass a width argument to the count stat, which controls the widths of the bars. `width = 1` will make the bars wide enough to touch each other.