diff --git a/programming.qmd b/programming.qmd index 6d546e3d..83ffe590 100644 --- a/programming.qmd +++ b/programming.qmd @@ -255,7 +255,7 @@ For example, you could wrap up the complete code needed to make a piechart: ```{r} piechart <- function(data, mapping) { ggplot(data, mapping) + - geom_bar(width = 1) + + geom_bar(width = 1, position = "fill") + coord_polar(theta = "y") + xlab(NULL) + ylab(NULL) @@ -333,7 +333,7 @@ This makes it easy to update our piechart function: ```{r} piechart <- function(data, var) { ggplot(data, aes(factor(1), fill = {{ var }})) + - geom_bar(width = 1) + + geom_bar(width = 1, position = "fill") + coord_polar(theta = "y") + xlab(NULL) + ylab(NULL)