Skip to content

Commit

Permalink
open argument
Browse files Browse the repository at this point in the history
  • Loading branch information
edward-burn committed Nov 14, 2024
1 parent efa4cfa commit 2e84b9a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion R/shinyDiagnostics.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#'
#' @inheritParams resultDoc
#' @inheritParams directoryDoc
#' @param open If TRUE, the shiny app will be launched in a new session. If
#' FALSE, the shiny app will be created but not launched.
#'
#' @return A shiny app
#' @export
Expand Down Expand Up @@ -50,7 +52,8 @@
#' shinyDiagnostics(my_result_cohort_diag, here::here())
#' }
shinyDiagnostics <- function(result,
directory){
directory,
open = rlang::is_interactive()){

file.copy(from = system.file("shiny",
package = "PhenotypeR"),
Expand All @@ -62,6 +65,10 @@ shinyDiagnostics <- function(result,
fileName = "result.csv",
path = file.path(directory, "shiny", "data", "raw"))
# shiny::shinyAppDir(file.path(directory, "shiny"))
if (isTRUE(open)) {
usethis::proj_activate(directory)
}

return(invisible())

}
5 changes: 4 additions & 1 deletion man/shinyDiagnostics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2e84b9a

Please sign in to comment.