jupyter-xeus / xeus-r

Jupyter kernel for the R programming language
Other
40 stars 5 forks source link

Figure out why `print.gt` opens a new window #76

Open romainfrancois opened 7 months ago

romainfrancois commented 7 months ago

Might be related to #75

library(gt)

# Define the start and end dates for the data range
start_date <- "2010-06-07"
end_date <- "2010-06-14"

# Create a gt table based on preprocessed
# `sp500` table data
sp500 |>
  dplyr::filter(date >= start_date & date <= end_date) |>
  dplyr::select(-adj_close) |>
  gt() |>
  tab_header(
    title = "S&P 500",
    subtitle = glue::glue("{start_date} to {end_date}")
  ) |>
  fmt_currency() |>
  fmt_date(columns = date, date_style = "wd_m_day_year") |>
  fmt_number(columns = volume, suffixing = TRUE)