R/show_in_excel.R

Defines functions show_in_excel

Documented in show_in_excel

#' Write Dataframe to a temp excel file and open it.
#'
#' @param .data Dataframe
#'
#' @export
#' @returns nothing
#' @examplesIf interactive()
#' # View a data set in excel
#' mtcars |> show_in_excel()
#'
#'
show_in_excel <- function(.data) {
  tmp <- paste0(tempfile(), ".csv")
  readr::write_excel_csv(.data, tmp)
  utils::browseURL(url = tmp)
}

Try the tntpr package in your browser

Any scripts or data that you put into this service are public.

tntpr documentation built on April 3, 2025, 8:48 p.m.