-
Notifications
You must be signed in to change notification settings - Fork 23
/
table.R
51 lines (48 loc) · 1.06 KB
/
table.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
46
47
48
49
50
51
library(tidyverse)
library(gt)
library(glue)
workshops <- read_csv("workshops.csv") |>
mutate(
day_1 = glue("[{day_1}](https://posit-conf-2023.github.io/workshops/workshops/{day_1_slug}/)"),
day_2 = glue("[{day_2}](https://posit-conf-2023.github.io/workshops/workshops/{day_2_slug}/)")
) |>
select(-room, -contains("slug"))
workshops |>
filter(type == "2-day") |>
select(-type) |>
gt() |>
cols_merge(
rows = is.na(day_2),
columns = c(day_1, day_2),
pattern = "{1}"
) |>
cols_width(day_1 ~ px(800)) |>
cols_align(day_1, align = "center") |>
cols_label(day_1 = "Both Days")
workshops |>
filter(type == "1-day") |>
select(-type) |>
gt() |>
fmt_markdown() |>
cols_width(
day_1 ~ px(400),
day_2 ~ px(400)
) |>
cols_align(
align = "left",
columns = c(day_1, day_2)
) |>
tab_style(
style = cell_borders(
sides = c("right"),
style = "solid"
),
locations = cells_body(
columns = day_1,
rows = everything()
)
) |>
cols_label(
day_1 = "Day 1",
day_2 = "Day 2"
)