Skip to content

Commit 819bcf5

Browse files
committed
export sourceProcess
1 parent e58854e commit 819bcf5

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export(getMKStat)
99
export(process_extraction)
1010
export(process_trend)
1111
export(randomizedNormalScore)
12+
export(sourceProcess)
1213
importFrom(data.table,":=")
1314
importFrom(magrittr,"%>%")
1415
importFrom(rlang,.data)

R/CARD_process.R

+20-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,26 @@ CARD_extraction = function (data,
400400
}
401401

402402

403-
403+
#' @title sourceProcess
404+
#' @description Allows read CARD with is formatism and convert it to a `Process` variable that explain all the step necessary for the extraction of [process_extraction()].
405+
#'
406+
#' @param path A [character][base::character] string as a path to the CARD file.
407+
#' @param default The default process loaded by `Process_default = sourceProcess(file.path(CARD_path, "__default__.R"))` to load the default parameters of every extraction process. Default `NULL`.
408+
#' @return A `Process` variable which is a list of general parameters, and sub list for each extraction process parameters.
409+
#' @seealso
410+
#' - [process_extraction()] for extracting variables.
411+
#' - [process_trend()] for performing trend analysis on extracted variables.
412+
#' - [CARD_management()] for managing CARD parameterization files.
413+
#' - [CARD_extraction()] for extracting variables using CARD parameterization files.
414+
#'
415+
#' @examples
416+
#' \dontrun{
417+
#' Process_default = sourceProcess(path="path/to/CARD/__default__.R")
418+
#' Process = sourceProcess(path="path/to/CARD/script.R",
419+
#' default=Process_default)
420+
#' }
421+
#' @export
422+
#' @md
404423
sourceProcess = function (path, default=NULL) {
405424
CARD = new.env()
406425
source(path, local=CARD, encoding='UTF-8')

0 commit comments

Comments
 (0)