# NOT RUN {
# Use `gtcars` to create a gt table;
# Group several columns related to car
# performance under a spanner column
# with the label `performance`
tab_1 <-
gtcars %>%
dplyr::select(
-mfr, -trim, bdy_style, drivetrain,
-drivetrain, -trsmn, -ctry_origin
) %>%
dplyr::slice(1:8) %>%
gt(rowname_col = "model") %>%
tab_spanner(
label = "performance",
columns = vars(
hp, hp_rpm, trq, trq_rpm,
mpg_c, mpg_h)
)
# }
Run the code above in your browser using DataLab