Comment detail

コマンドライン引数の取得 (Nested Flatten)
Rは対話型インターフェイスが基本なので、コマンドライン引数の取得は
実はあまり「簡単なお仕事」ではないかもしれません。

起動オプションに --args a b c d と指定するとコマンドライン引数として使うことができます。
trailingOnly=TRUE にしない場合(デフォルト)は全ての起動オプションを取得します。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
> commandArgs(trailingOnly=TRUE)
[1] "a" "b" "c" "d"

> commandArgs()
[1] "(略)\\R\\bin\\Rgui.exe"
[2] "--args"                                          
[3] "a"                                               
[4] "b"                                               
[5] "c"                                               
[6] "d"

Index

Feed

Other

Link

Pathtraq

loading...