R/connection_shinyapp.R

Defines functions connection_spark_shinyapp

Documented in connection_spark_shinyapp

# nocov start

#' A Shiny app that can be used to construct a \code{spark_connect} statement
#'
#' @importFrom rstudioapi showQuestion
#'
#' @export
#' @keywords internal
connection_spark_shinyapp <- function() {
  if (!"shiny" %in% installed.packages()) {
    install_shiny <- showQuestion("Shiny Required", "The 'shiny' package is not installed, install?", ok = "Install")
    if (identical(install_shiny, TRUE)) {
      install_command <- get("install.packages")
      install_command("shiny")
    }

    if (!"shiny" %in% installed.packages()) {
      stop("The 'shiny' package is not installed, please install and retry.")
    }
  }

  shinyAppDir <- get("shinyAppDir", envir = asNamespace("shiny"))
  shinyAppDir(system.file("rstudio/shinycon", package = "sparklyr"))
}

# nocov end

Try the sparklyr package in your browser

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

sparklyr documentation built on Jan. 8, 2022, 5:06 p.m.