|>
metro ::select(name, caption, lines, connect_rer) |>
dplyr::slice_head(n = 10) |>
dplyrgt() |>
cols_merge(
columns = c(name, caption),
pattern = "{1}<< ({2})>>"
|>
) text_replace(
locations = cells_body(columns = name),
pattern = "\\((.*?)\\)",
replacement = "<br>(<em>\\1</em>)"
|>
) sub_missing(columns = connect_rer, missing_text = "") |>
fmt_image(
columns = lines,
path = system.file("metro_svg", package = "gt"),
file_pattern = "metro_{x}.svg"
|>
) fmt_image(
columns = connect_rer,
path = system.file("metro_svg", package = "gt"),
file_pattern = "rer_{x}.svg"
|>
) cols_label(
name = "Station",
lines = "Lines",
connect_rer = "RER"
|>
) cols_align(align = "left") |>
tab_style(
style = cell_borders(
sides = c("left", "right"),
weight = px(1),
color = "gray85"
),locations = cells_body(columns = lines)
|>
) opt_stylize(style = 6, color = "blue") |>
opt_all_caps() |>
opt_horizontal_padding(scale = 1.75)
Station | Lines | RER |
---|---|---|
Argentine | ||
Bastille | ||
Bérault | ||
Champs-Élysées—Clemenceau (Grand Palais) |
||
Charles de Gaulle—Étoile | ||
Château de Vincennes | ||
Châtelet | ||
Concorde | ||
Esplanade de La Défense | ||
Franklin D. Roosevelt |