Rscript
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
*Rscript [#j81097ff]
WindowsOSコマンドライン実行用~
R2.5.0から使えるようになっている~
RCMD BATCHより柔軟~
Usage: /path/to/Rscript [--options] [-e expr] file [args]
--options accepted are
--help Print usage and exit
--version Print version and exit
--verbose Print information on progress
--default-packages=list
Where 'list' is a comma-separated set
of package names, or 'NULL'
or options to R, in addition to --slave --no-restore, suc...
--save Do save workspace at the end of the...
--no-environ Don't read the site and user enviro...
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the .Rprofile or ~/.Rpro...
--restore Do restore previously saved objects...
--vanilla Combine --no-save, --no-restore, --...
--no-init-file and --no-environ
**利用例: [#ia1b5c5e]
http://androids.happy.nu/ja/r-intro-lecture より抜粋
***バッチ実行(Rscript) [#jd16bc2c]
バッチ実行には、Rscript.exe を使うこともできます。~
Rscript [--options] [-e expr] inputfile [args]
Rscript には出力ファイルを指定するオプションがありません...
Windows 版の Rcmd BATCH ではスクリプトへ引数を渡す機能が...
Rscript は直接に表現式を書ける -e オプションが利用でき(...
Rscript -e "commandArgs(); proc.time()" arg1 arg2 arg3
***リダイレクト [#ub0a4c48]
Rscript [--options] [-e expr] inputfile [args] > output...
inputfileがutf-8で作成されていると、outputfileもutf-8にな...
*UNIX(系) [#j7d0f714]
UNIX~
R(1) FSF ...
NAME
R - a language for data analysis and graphics
SYNOPSIS
R [options] [< infile] [> outfile]
R CMD command [arguments]
DESCRIPTION
Start R, a system for statistical computation ...
specified options, or invoke an R tool via the 'R...
R is a language which bears a passing resemblance...
developed at AT&T Bell Laboratories. It provides...
of statistical and graphical analyses. R is a tr...
which contains a number of control-flow construct...
alternation. It allows users to add additional f...
ing new functions.
On platforms which support the dlopen(3) interfa...
can be linked and called at run time.
On systems which have the GNU readline(3) library...
command history, so that commands can be recall...
cuted.
OPTIONS
Most options control what happens at the beginnin...
R session, in particular which files are being...
how much memory is reserved for the R process.
-h, --help
Print short help message and exit
--version
Print version info and exit
RHOME Print path to R home directory and exit
--save Do save data sets at the end of the session
--no-save
Don't save them
--no-environ
Don't read the site and user environment f...
--no-site-file
Don't read the site-wide Rprofile
--no-init-file
Don't read the .Rprofile or ~/.Rprofile fi...
--restore
Do restore previously saved data sets at s...
--no-restore-data
Don't restore previously saved data sets
--no-restore-history
Don't restore the R history file
--no-restore
Don't restore anything
--vanilla
Combine --no-save, --no-restore, --no-site...
and --no-environ
--no-readline
Don't use readline for command-line editing
--min-vsize=N
Set vector heap min to N bytes; '4M' = 4 M...
--max-vsize=N
Set vector heap max to N bytes;
--min-nsize=N
Set min number of cons cells to N
--max-nsize=N
Set max number of cons cells to N
-q, --quiet
Don't print startup message
--silent
Same as --quiet
--slave
Make R run as quietly as possible
--verbose
Print more information about progress
-d, --debugger=NAME
Run R through debugger NAME
--debugger-args=ARGS
Pass ARGS as arguments to the debugger
-g, --gui=TYPE
Use TYPE as GUI; possible values are 'X11'...
'gnome'
--args Skip the rest of the command line
Commands:
BATCH Run R in batch mode
COMPILE
Compile files for use with R
SHLIB Build shared library for dynamic loading
INSTALL
Install add-on packages
REMOVE Remove add-on packages
build Build add-on packages
check Check add-on packages
LINK Front-end for creating executable programs
Rprof Post-process R profiling files
Rdconv Convert Rd format to various other formats
Rd2dvi Convert Rd format to DVI/PDF
Rd2txt Convert Rd format to pretty text
Sd2Rd Convert S documentation to Rd format
config Obtain configuration information about R
The first five tools (i.e., BATCH, COMPILE, SHLIB...
can also be invoked without the 'CMD' option.
Please use 'R CMD command --help' to obtain fur...
the usage of 'command'.
REPORTING BUGS
Report bugs to <r-bugs@r-project.org>.
COPYRIGHT
Copyright (C) 2003 R Development Core Team
R is free software and comes with ABSOLUTELY NO W...
come to redistribute it under the terms of ...
License. For more information about th...
http://www.gnu.org/copyleft/gpl.html.
SEE ALSO
The full documentation for R is provided by a...
manuals and individual help for R objects which i...
line.
Start R and type ?topic at the R prompt to obta...
for `topic'.
If the processed manuals have been installed they...
DVI and/or PDF files in the directory `R RHOME`/d...
If the info program and the R manuals are ins...
typing info -f R-intro, info -f R-data, info -f ...
and info -f R-lang should give you access to ``...
(the basic manual), the ``R Data Import/Export'' ...
sion Writer's Guide'', the ``R FAQ'' and the ``...
tion''.
R 1.8.1 November 2003 ...
=========================
$ cat r.R
summary(iris)
$ R --vanilla --silent < r.R > r.output
$ cat r.output
> summary(iris)
Sepal.Length Sepal.Width Petal.Length Petal....
Min. :4.300 Min. :2.000 Min. :1.000 Min. ...
1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu....
Median :5.800 Median :3.000 Median :4.350 Median ...
Mean :5.843 Mean :3.057 Mean :3.758 Mean ...
3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu....
Max. :7.900 Max. :4.400 Max. :6.900 Max. ...
Species
setosa :50
versicolor:50
virginica :50
*コメント [#d550c0bb]
- Apache などのWeb Service での利用例はないでしょうか? -...
- 以下のような form を作って,action を記述する a.cgi を...
HTML ファイル
<html>
<head>
<title>ドライバー</title>
</head>
<body>
<form method="post" action="a.cgi">
<input type="submit" value="go">
<input type="reset" value="reset">
</form>
</body>
</html>
スクリプト(a.cgi)
#!/usr/local/bin/gawk -f
BEGIN {
out = "a.R"
print "cat('Content-type: text/html\n\n<html><head><tit...
print "x <- rnorm(1000); mean(x)" > out
print "</body></html>" > out
close(out)
system("/usr/local/bin/R --vanilla --slave < a.R")
}
- ありがとうございます。参考にさせていただきます。 -- [[T...
#comment
終了行:
#contents
*Rscript [#j81097ff]
WindowsOSコマンドライン実行用~
R2.5.0から使えるようになっている~
RCMD BATCHより柔軟~
Usage: /path/to/Rscript [--options] [-e expr] file [args]
--options accepted are
--help Print usage and exit
--version Print version and exit
--verbose Print information on progress
--default-packages=list
Where 'list' is a comma-separated set
of package names, or 'NULL'
or options to R, in addition to --slave --no-restore, suc...
--save Do save workspace at the end of the...
--no-environ Don't read the site and user enviro...
--no-site-file Don't read the site-wide Rprofile
--no-init-file Don't read the .Rprofile or ~/.Rpro...
--restore Do restore previously saved objects...
--vanilla Combine --no-save, --no-restore, --...
--no-init-file and --no-environ
**利用例: [#ia1b5c5e]
http://androids.happy.nu/ja/r-intro-lecture より抜粋
***バッチ実行(Rscript) [#jd16bc2c]
バッチ実行には、Rscript.exe を使うこともできます。~
Rscript [--options] [-e expr] inputfile [args]
Rscript には出力ファイルを指定するオプションがありません...
Windows 版の Rcmd BATCH ではスクリプトへ引数を渡す機能が...
Rscript は直接に表現式を書ける -e オプションが利用でき(...
Rscript -e "commandArgs(); proc.time()" arg1 arg2 arg3
***リダイレクト [#ub0a4c48]
Rscript [--options] [-e expr] inputfile [args] > output...
inputfileがutf-8で作成されていると、outputfileもutf-8にな...
*UNIX(系) [#j7d0f714]
UNIX~
R(1) FSF ...
NAME
R - a language for data analysis and graphics
SYNOPSIS
R [options] [< infile] [> outfile]
R CMD command [arguments]
DESCRIPTION
Start R, a system for statistical computation ...
specified options, or invoke an R tool via the 'R...
R is a language which bears a passing resemblance...
developed at AT&T Bell Laboratories. It provides...
of statistical and graphical analyses. R is a tr...
which contains a number of control-flow construct...
alternation. It allows users to add additional f...
ing new functions.
On platforms which support the dlopen(3) interfa...
can be linked and called at run time.
On systems which have the GNU readline(3) library...
command history, so that commands can be recall...
cuted.
OPTIONS
Most options control what happens at the beginnin...
R session, in particular which files are being...
how much memory is reserved for the R process.
-h, --help
Print short help message and exit
--version
Print version info and exit
RHOME Print path to R home directory and exit
--save Do save data sets at the end of the session
--no-save
Don't save them
--no-environ
Don't read the site and user environment f...
--no-site-file
Don't read the site-wide Rprofile
--no-init-file
Don't read the .Rprofile or ~/.Rprofile fi...
--restore
Do restore previously saved data sets at s...
--no-restore-data
Don't restore previously saved data sets
--no-restore-history
Don't restore the R history file
--no-restore
Don't restore anything
--vanilla
Combine --no-save, --no-restore, --no-site...
and --no-environ
--no-readline
Don't use readline for command-line editing
--min-vsize=N
Set vector heap min to N bytes; '4M' = 4 M...
--max-vsize=N
Set vector heap max to N bytes;
--min-nsize=N
Set min number of cons cells to N
--max-nsize=N
Set max number of cons cells to N
-q, --quiet
Don't print startup message
--silent
Same as --quiet
--slave
Make R run as quietly as possible
--verbose
Print more information about progress
-d, --debugger=NAME
Run R through debugger NAME
--debugger-args=ARGS
Pass ARGS as arguments to the debugger
-g, --gui=TYPE
Use TYPE as GUI; possible values are 'X11'...
'gnome'
--args Skip the rest of the command line
Commands:
BATCH Run R in batch mode
COMPILE
Compile files for use with R
SHLIB Build shared library for dynamic loading
INSTALL
Install add-on packages
REMOVE Remove add-on packages
build Build add-on packages
check Check add-on packages
LINK Front-end for creating executable programs
Rprof Post-process R profiling files
Rdconv Convert Rd format to various other formats
Rd2dvi Convert Rd format to DVI/PDF
Rd2txt Convert Rd format to pretty text
Sd2Rd Convert S documentation to Rd format
config Obtain configuration information about R
The first five tools (i.e., BATCH, COMPILE, SHLIB...
can also be invoked without the 'CMD' option.
Please use 'R CMD command --help' to obtain fur...
the usage of 'command'.
REPORTING BUGS
Report bugs to <r-bugs@r-project.org>.
COPYRIGHT
Copyright (C) 2003 R Development Core Team
R is free software and comes with ABSOLUTELY NO W...
come to redistribute it under the terms of ...
License. For more information about th...
http://www.gnu.org/copyleft/gpl.html.
SEE ALSO
The full documentation for R is provided by a...
manuals and individual help for R objects which i...
line.
Start R and type ?topic at the R prompt to obta...
for `topic'.
If the processed manuals have been installed they...
DVI and/or PDF files in the directory `R RHOME`/d...
If the info program and the R manuals are ins...
typing info -f R-intro, info -f R-data, info -f ...
and info -f R-lang should give you access to ``...
(the basic manual), the ``R Data Import/Export'' ...
sion Writer's Guide'', the ``R FAQ'' and the ``...
tion''.
R 1.8.1 November 2003 ...
=========================
$ cat r.R
summary(iris)
$ R --vanilla --silent < r.R > r.output
$ cat r.output
> summary(iris)
Sepal.Length Sepal.Width Petal.Length Petal....
Min. :4.300 Min. :2.000 Min. :1.000 Min. ...
1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu....
Median :5.800 Median :3.000 Median :4.350 Median ...
Mean :5.843 Mean :3.057 Mean :3.758 Mean ...
3rd Qu.:6.400 3rd Qu.:3.300 3rd Qu.:5.100 3rd Qu....
Max. :7.900 Max. :4.400 Max. :6.900 Max. ...
Species
setosa :50
versicolor:50
virginica :50
*コメント [#d550c0bb]
- Apache などのWeb Service での利用例はないでしょうか? -...
- 以下のような form を作って,action を記述する a.cgi を...
HTML ファイル
<html>
<head>
<title>ドライバー</title>
</head>
<body>
<form method="post" action="a.cgi">
<input type="submit" value="go">
<input type="reset" value="reset">
</form>
</body>
</html>
スクリプト(a.cgi)
#!/usr/local/bin/gawk -f
BEGIN {
out = "a.R"
print "cat('Content-type: text/html\n\n<html><head><tit...
print "x <- rnorm(1000); mean(x)" > out
print "</body></html>" > out
close(out)
system("/usr/local/bin/R --vanilla --slave < a.R")
}
- ありがとうございます。参考にさせていただきます。 -- [[T...
#comment
ページ名: