comparison Intchecks/wrapper_intensity_check.R @ 6:ec75de7f1e08 draft default tip

Uploaded
author melpetera
date Mon, 11 Dec 2023 12:56:20 +0000
parents 49c36c54e0cf
children
comparison
equal deleted inserted replaced
5:a31f3f802b2b 6:ec75de7f1e08
12 # Output: VariableMetadata, Graphics # 12 # Output: VariableMetadata, Graphics #
13 # # 13 # #
14 # # 14 # #
15 ############################################################################# 15 #############################################################################
16 16
17
18 library(batch) #necessary for parseCommandArgs function
19 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
20
21 source_local <- function(...){ 17 source_local <- function(...){
22 argv <- commandArgs(trailingOnly = FALSE) 18 argv <- commandArgs(trailingOnly = FALSE)
23 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) 19 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
24 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))} 20 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))}
25 } 21 }
26 #Import the different functions 22 #Import the different functions
27 source_local("Script_intensity_check.R", "RcheckLibrary.R") 23 source_local("parseargs.R", "Script_intensity_check.R", "RcheckLibrary.R")
24
25 args = parse_args() #interpretation of arguments given in command line as an R list of objects
28 26
29 27
30 if(length(args) < 7){ stop("NOT enough argument !!!") } 28 if(length(args) < 7){ stop("NOT enough argument !!!") }
31 29
32 cat('\nJob starting time:\n',format(Sys.time(), "%a %d %b %Y %X"), 30 cat('\nJob starting time:\n',format(Sys.time(), "%a %d %b %Y %X"),