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}
|
```{r, fig.align = "default", out.width = "50%", fig.width = 4}
|
||||||
by_age <- gss_cat %>%
|
by_age <- gss_cat %>%
|
||||||
filter(!is.na(age)) %>%
|
filter(!is.na(age)) %>%
|
||||||
group_by(age, marital) %>%
|
count(age, marital) %>%
|
||||||
count() %>%
|
group_by(age) %>%
|
||||||
mutate(prop = n / sum(n))
|
mutate(prop = n / sum(n))
|
||||||
|
|
||||||
ggplot(by_age, aes(age, prop, colour = marital)) +
|
ggplot(by_age, aes(age, prop, colour = marital)) +
|
||||||
|
|
Loading…
Reference in New Issue