cc_staff
653
edits
No edit summary |
(fix code-block) |
||
Line 155: | Line 155: | ||
== Passing arguments to R scripts == <!--T:84--> | == Passing arguments to R scripts == <!--T:84--> | ||
Sometimes it can be useful to pass parameters as arguments to R scripts, to avoid having to either change the R script for every job or having to manage multiple copies of otherwise identical scripts. This can be useful for specifying the names for input- or output files, as well as specifying numerical parameters. For example, instead of specifying the name of an input file and/or a numerical parameter like this | Sometimes it can be useful to pass parameters as arguments to R scripts, to avoid having to either change the R script for every job or having to manage multiple copies of otherwise identical scripts. This can be useful for specifying the names for input- or output files, as well as specifying numerical parameters. For example, instead of specifying the name of an input file and/or a numerical parameter like this | ||
{{ | {{File | ||
|filename = "input.csv" | |name= | ||
|lang="R" | |||
|contents= | |||
filename = "input.csv" | |||
iterations = 5 | |||
}} | }} | ||
and changing the code every time either of these changes, parameters can be passed to the R-script when starting it: | and changing the code every time either of these changes, parameters can be passed to the R-script when starting it: |