Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) commandArgs <- function() { ## nolint list( "--args", "a-integer", "42", "a-float", "3.14", "a-boolean", "FALSE", "a-list", "1,2,3" ) }
library(W4MRUtils)
```{sh how to run scritp, eval=FALSE} Rscript my_script.R --a-integer 42 --a-float 3.14 --a-boolean FALSE --a-list 1,2,3
### Parse those parameters in the R script ```r param_printer <- function(name, args) { sprintf( "%s[%s] %s", name, class(args[[name]])[1], paste(args[[name]], collapse = " ") ) } args <- W4MRUtils::parse_args(commandArgs()) args param_printer("a_integer", args) param_printer("a_float", args) param_printer("a_boolean", args) param_printer("a_list", args) args$a_list <- as.numeric(strsplit(args$a_list, ",")[[1]]) param_printer("a_list", args)
param_printer <- function(name, args) { sprintf( "%s[%s] %s", name, class(args[[name]])[1], paste(args[[name]], collapse = " ") ) } args <- W4MRUtils::parse_args( commandArgs(), convert_booleans = FALSE, convert_numerics = FALSE ) args param_printer("a-integer", args) param_printer("a-float", args) param_printer("a-boolean", args) param_printer("a-list", args)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.