以下を使用して R スクリプトを実行しようとしています。
c:\Progra~1\R\R-2.13.1\bin\R CMD BATCH "test.R"
ファイル test.R には以下が含まれます
print ("Hello World")
ただし、次のエラーが発生し続けます。上記の例は、デバッグを容易にするために 1 行だけに単純化されています。
R version 2.13.1 (2011-07-08)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> pError: unexpected input in "print ("Hello World")
"
Execution halted
; を追加すると機能します。印刷後に署名 ("Hello World") しますが、test.R に他の行がある場合、それらの行は実行されません。
アドバイスをお願いします。