knitr::opts_chunk$set(echo = TRUE)
library(gt)

Create a display table based on morley Michelson Speed of Light Data

gt(morley %>% dplyr::mutate(Speed = as.numeric(Speed))) %>%
  fmt_number(
    columns = Speed,
    decimals = 0,
    sep_mark = ","
  ) %>%
  cols_align(align = "left", columns = c(Run, Speed))


rstudio/gt documentation built on Nov. 2, 2024, 5:53 p.m.