mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
feat: launch function prepared for optional limits to data import. this will also provide future options for customisations
This commit is contained in:
parent
31114dfd2b
commit
1b31743898
1 changed files with 20 additions and 4 deletions
|
|
@ -3,6 +3,11 @@
|
||||||
#' @description
|
#' @description
|
||||||
#' All data.frames in the global environment will be accessible through the app.
|
#' All data.frames in the global environment will be accessible through the app.
|
||||||
#'
|
#'
|
||||||
|
#' @param include_globalenv flag to include global env (local data) as option
|
||||||
|
#' when loading data
|
||||||
|
#' @param data_limit_default default data set observations limit
|
||||||
|
#' @param data_limit_upper data set observations upper limit
|
||||||
|
#' @param data_limit_lower data set observations lower limit
|
||||||
#' @param ... passed on to `shiny::runApp()`
|
#' @param ... passed on to `shiny::runApp()`
|
||||||
#'
|
#'
|
||||||
#' @returns shiny app
|
#' @returns shiny app
|
||||||
|
|
@ -13,13 +18,24 @@
|
||||||
#' data(mtcars)
|
#' data(mtcars)
|
||||||
#' launch_FreesearchR(launch.browser = TRUE)
|
#' launch_FreesearchR(launch.browser = TRUE)
|
||||||
#' }
|
#' }
|
||||||
launch_FreesearchR <- function(...){
|
launch_FreesearchR <- function(inlcude_globalenv = TRUE,
|
||||||
|
data_limit_default = 1000,
|
||||||
|
data_limit_upper = 100000,
|
||||||
|
data_limit_lower = 1,
|
||||||
|
...) {
|
||||||
|
global_freesearchR <- list(
|
||||||
|
include_globalenv = include_globalenv,
|
||||||
|
data_limit_default = data_limit_default,
|
||||||
|
data_limit_upper = data_limit_upper,
|
||||||
|
data_limit_lower = data_limit_lower
|
||||||
|
)
|
||||||
|
|
||||||
appDir <- system.file("apps", "FreesearchR", package = "FreesearchR")
|
appDir <- system.file("apps", "FreesearchR", package = "FreesearchR")
|
||||||
if (appDir == "") {
|
if (appDir == "") {
|
||||||
stop("Could not find the app directory. Try re-installing `FreesearchR`.", call. = FALSE)
|
stop("Could not find the app directory. Try re-installing `FreesearchR`.",
|
||||||
|
call. = FALSE)
|
||||||
}
|
}
|
||||||
|
|
||||||
a <- shiny::runApp(appDir = paste0(appDir,"/app.R"), ...)
|
a <- shiny::runApp(appDir = paste0(appDir, "/app.R"), ...)
|
||||||
return(invisible(a))
|
return(invisible(a))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue