launch_app.R 1.93 KB
Newer Older
1
2
# miRacumDQA - The MIRACUM consortium's data quality assessment tool
# Copyright (C) 2019 Universitätsklinikum Erlangen
kapsner's avatar
kapsner committed
3
#
kapsner's avatar
kapsner committed
4
5
6
7
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
kapsner's avatar
kapsner committed
8
#
kapsner's avatar
kapsner committed
9
10
11
12
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
kapsner's avatar
kapsner committed
13
#
kapsner's avatar
kapsner committed
14
15
16
17
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#' @title Launch the MIRACUM DQA Tool
kapsner's avatar
kapsner committed
18
#'
19
#' @param port The port, the MIRACUM DQA Tool is running on (default: 3838)
20
21
22
23
24
25
#' @param utilspath The path to the utilities-folder, containing the metadata repository files (`mdr.csv` inside the folder `MDR`),
#'   JSON files with SQL statements (inside the folder `SQL`), config files for the database connection (`settings_default.yml`)
#'   and the email address used for the data map (`email.yml`), a JSON file containing site names (inside the folder `MISC`) and a
#'   markdown templated to create the PDF report (`DQA_report.Rmd` inside the folder `RMD`).
#' @param db_source The name of the source database. Currently, the only allowed argument is `p21csv` used for the import of the
#'   corresponding csv files.
kapsner's avatar
kapsner committed
26
#'
27
#' @return the MIRACUM DQA Tool Shiny application
kapsner's avatar
kapsner committed
28
#'
29
#' @import DQAgui shiny
kapsner's avatar
kapsner committed
30
#'
kapsner's avatar
kapsner committed
31
#' @export
kapsner's avatar
kapsner committed
32
#'
kapsner's avatar
kapsner committed
33

34
launchDQAtool <- function(port=3838, utilspath, db_source){
kapsner's avatar
kapsner committed
35
  options(shiny.port = port)
36
37
  assign("utilspath", utilspath, envir = .GlobalEnv)
  assign("db_source", db_source, envir = .GlobalEnv)
38

Lorenz Kapsner's avatar
Lorenz Kapsner committed
39
  shiny::shinyAppDir(appDir = system.file("application", package = "miRacumDQA"))
kapsner's avatar
kapsner committed
40
}
41
42
43

# debugging
# launchDQAtool(utilspath = "./_utilities/", db_source = "p21csv")