Update factors.Rmd (#624)
This commit is contained in:
parent
8fee078c9d
commit
02502a6ebc
|
@ -209,8 +209,8 @@ Another type of reordering is useful when you are colouring the lines on a plot.
|
|||
```{r, fig.align = "default", out.width = "50%", fig.width = 4}
|
||||
by_age <- gss_cat %>%
|
||||
filter(!is.na(age)) %>%
|
||||
group_by(age, marital) %>%
|
||||
count() %>%
|
||||
count(age, marital) %>%
|
||||
group_by(age) %>%
|
||||
mutate(prop = n / sum(n))
|
||||
|
||||
ggplot(by_age, aes(age, prop, colour = marital)) +
|
||||
|
|
Loading…
Reference in New Issue