forked from sylvainschmitt/sdmverse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch_app.R
34 lines (33 loc) · 1001 Bytes
/
launch_app.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#' @include utils-pipe.R
#' @importFrom shiny runApp
#' @importFrom DT renderDataTable dataTableOutput
NULL
#' Launch sdmverse App
#
#' This function launch the sdmverse application.
#'
#' @param port char. The TCP port that the application should listen on (see
#' \code{\link[shiny]{runApp}} for more details).
#' @param host char. The IPv4 address that the application should listen on (see
#' \code{\link[shiny]{runApp}} for more details).
#'
#' @return Open a window with a shiny app to use the SSDM package with an
#' user-friendly interface.
#'
#' @examples
#' \dontrun{
#' launch_app()
#' }
#'
#' @export
#'
launch_app <- function(port = getOption("shiny.port"),
host = getOption("shiny.host", "127.0.0.1")) {
app_dir <- system.file("app", package = "sdmverse")
if (app_dir == "") {
stop("Could not find shiny directory. Try re-installing `ssdmverse`.",
call. = FALSE
)
}
runApp(app_dir, display.mode = "normal", port = port, host = host)
}