Skip to content

Instantly share code, notes, and snippets.

@maxdrohde
Created January 15, 2024 20:57
Show Gist options
  • Save maxdrohde/4e5b988a2200cb51911be71e26927393 to your computer and use it in GitHub Desktop.
Save maxdrohde/4e5b988a2200cb51911be71e26927393 to your computer and use it in GitHub Desktop.
display.R
# Display data frame as a nicely formatted and interactive GT table
display <- function(df){
df |>
gt::gt() |>
gt::opt_interactive(use_search = TRUE,
use_compact_mode = TRUE,
use_text_wrapping = TRUE) |>
gt::opt_stylize(style = 2) |>
gt::cols_width(everything() ~ px(250))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment