-
Notifications
You must be signed in to change notification settings - Fork 3
/
11_solution.R
45 lines (27 loc) · 852 Bytes
/
11_solution.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
library(ggplot2)
ggplot(ex_adsl, mapping = aes(x = AGE)) +
geom_boxplot() +
facet_grid(cols = vars(ARM))
library(rtables)
lyt <- basic_table() |>
split_cols_by("ARM") |>
analyze("AGE", range, format = "xx.xx - xx.xx")
build_table(lyt, ex_adsl)
ggplot(ex_adsl, mapping = aes(x = AGE)) +
geom_boxplot() +
facet_grid(rows = vars(SEX))
ggplot(ex_adsl, mapping = aes(x = AGE)) +
geom_boxplot() +
facet_grid(rows = vars(ARM))
lyt2 <- basic_table() |>
split_rows_by("SEX") |>
analyze("AGE", range, format = "xx.xx - xx.xx")
build_table(lyt2, ex_adsl)
ggplot(ex_adsl, mapping = aes(x = AGE)) +
geom_boxplot() +
facet_grid(rows = vars(SEX), cols = vars(ARM))
lyt3 <- basic_table() |>
split_cols_by("ARM") |>
split_rows_by("SEX") |>
analyze("AGE", range, format = "xx.xx - xx.xx")
build_table(lyt3, ex_adsl)