R/GreenplumR.R

## -----------------------------------------------------------------------
## start shiny GUI
## -----------------------------------------------------------------------

GreenplumR <- function ()
{
    if (length(.localVars$db) == 0)
        stop("No database connections! ",
             "You need at least one database connection before launching",
             " the graphical interface!")

    if (!("shiny" %in% .get.installed.pkgs())) {
        message(paste("Package shiny",
                      " is going to be installed so that ",
                      .this.pkg.name,
                      " could run its own shiny app.\n\n", sep = ""))
        install.packages(pkgs = "shiny")
        if (!("shiny" %in% .get.installed.pkgs()))
            stop("The package shiny could not be installed!")
    }
    ## GreenplumR's installation path
    ## .localVars$pkg.path <- path.package(.this.pkg.name)
    ## gui folder installation path
    gui.dir <- paste(.localVars$pkg.path, "/gui", sep = "")

    message("\nWelcome to GreenplumR GUI ...\n")
    message("Press Ctrl + c to stop.")
    shiny::runApp(gui.dir)
}

## -----------------------------------------------------------------------

greenplumr <- function ()
{
    GreenplumR()
}

## -----------------------------------------------------------------------

print.none.obj <- function (x, ...) { cat("") }
greenplum-db/GreenplumR documentation built on Sept. 2, 2023, 8:09 a.m.