R: Difference between revisions

Jump to navigation Jump to search
29 bytes added ,  2 years ago
fix code-block
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
{{Command
{{File
|filename = "input.csv"
  |name=
|iterations = 5
  |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:
cc_staff
682

edits

Navigation menu