mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 05:07:30 +02:00
included shiny app with package, bslib, documentation, fixing NA bug
This commit is contained in:
parent
1189da6c86
commit
3cfdb66a32
21 changed files with 767 additions and 270 deletions
|
|
@ -1,40 +1,39 @@
|
|||
utils::globalVariables(c("server"))
|
||||
#' Shiny server factory
|
||||
#'
|
||||
#' @return shiny server
|
||||
#' @export
|
||||
server_factory <- function() {
|
||||
source(here::here("app/server.R"))
|
||||
server
|
||||
}
|
||||
|
||||
#' UI factory for shiny app
|
||||
#'
|
||||
#' @return shiny ui
|
||||
#' @export
|
||||
ui_factory <- function() {
|
||||
# require(ggplot2)
|
||||
source(here::here("app/ui.R"))
|
||||
}
|
||||
|
||||
#' Launch the included Shiny-app for database casting and upload
|
||||
#'
|
||||
#' @description
|
||||
#' Wraps shiny::runApp()
|
||||
#'
|
||||
#' @param ... Arguments passed to shiny::runApp()
|
||||
#'
|
||||
#' @return shiny app
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' # shiny_cast()
|
||||
#'
|
||||
shiny_cast <- function() {
|
||||
# shiny::runApp(appDir = here::here("app/"), launch.browser = TRUE)
|
||||
shiny_cast <- function(...) {
|
||||
appDir <- system.file("shiny-examples", "casting", package = "REDCapCAST")
|
||||
if (appDir == "") {
|
||||
stop("Could not find example directory. Try re-installing `REDCapCAST`.", call. = FALSE)
|
||||
}
|
||||
|
||||
shiny::shinyApp(
|
||||
ui_factory(),
|
||||
server_factory()
|
||||
)
|
||||
shiny::runApp(appDir = appDir, ...)
|
||||
|
||||
# This is from the VarSelLCM
|
||||
# shiny_cast2 <- function(X){
|
||||
# check.results(X)
|
||||
# G <- .GlobalEnv
|
||||
# assign("resVSLC", X, envir=G)
|
||||
# a=shiny::runApp(system.file(package="REDCapCAST"),launch.browser = TRUE)
|
||||
# return(invisible(a))
|
||||
# }
|
||||
|
||||
# shiny::runApp(appDir = here::here("app/"),...)
|
||||
# ## Need adjustments to run anywhere
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' Helper to import files correctly
|
||||
#'
|
||||
#' @param filenames file names
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue