R/util_open_in_excel.R

Defines functions util_open_in_excel

Documented in util_open_in_excel

#' Open a data frame in Excel
#'
#' @param dfr the data frame
#'
#' @keywords internal
#'
#' @return 42
util_open_in_excel <- function(dfr) {
  withr::with_tempdir({
    fn <- paste0(
      as.character(substitute(dfr)), ".xlsx")
    rio::export(dfr, format = "xlsx", file = fn)
    fn <- normalizePath(fn)
    browseURL(fn)
    rstudioapi::showPrompt("Excel", "Close, when you are finished using Excel")
  })
  invisible(42)
}

Try the dataquieR package in your browser

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

dataquieR documentation built on May 29, 2024, 7:18 a.m.