library(mtbr) argv <- commandArgs(trailingOnly = TRUE) if (length(argv) > 0) { mtb_add_message(paste("The following arguments were passed to R: \n", paste(argv, collapse = ", "), sep = "", collapse = "")) for (arg in argv) { if (arg == "ArgToBePrintedToStdOut") { print(paste("The following arguments were printed to Stdout: '", arg, "'", sep = "", collapse = "")) } if (arg == "ArgToBePrintedToStdErr") { message(paste("The following arguments were printed to Stderr: '", arg, "'", sep = "", collapse = "")) } } } else { mtb_add_message("Minitab successfully located your R installation.") }