diff --git a/ch02.Rmd b/ch02.Rmd index 82a8b06..fb629a8 100644 --- a/ch02.Rmd +++ b/ch02.Rmd @@ -202,7 +202,7 @@ ggplot(BOD, aes(x = factor(Time), y = demand)) + geom_col() ``` -ggplot2 can also be used to plot the *count* of the number of data rows in each category (Figure \@ref(fig:FIG-QUICK-BAR-GGPLOT-COUNT), by using `geom_bar()` instead of `geom_col()`. Once again, notice the difference between a continuous x-axis and a discrete one. For some kinds of data, it may make more sense to convert the continuous x variable to a discrete one, with the `factor()` function. +ggplot2 can also be used to plot the *count* of the number of data rows in each category (Figure \@ref(fig:FIG-QUICK-BAR-GGPLOT-COUNT)), by using `geom_bar()` instead of `geom_col()`. Once again, notice the difference between a continuous x-axis and a discrete one. For some kinds of data, it may make more sense to convert the continuous x variable to a discrete one, with the `factor()` function. (ref:cap-FIG-QUICK-BAR-GGPLOT-COUNT) Bar graph of counts using `geom_bar()` with a continuous x variable (left); With x variable converted to a factor (right) @@ -385,4 +385,4 @@ ggplot(data.frame(x = c(0, 20)), aes(x = x)) + ### See Also -See Recipe \@ref(RECIPE-MISCGRAPH-FUNCTION) for more in-depth information about plotting function curves. \ No newline at end of file +See Recipe \@ref(RECIPE-MISCGRAPH-FUNCTION) for more in-depth information about plotting function curves.