RcmdrPlugin超入門
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
目次
#contents
*RcmdrPlugin超入門 [#vb0bf51c]
Rユーザー会2007でRcommanderのPluginの作り方を知りたい方...
ただし、Windows2000SP4,XPSP2上で作成する場合の方法ですの...
なお、Pluginの作成に当たっては舟尾さんの[[RCommanderハン...
(ここで公開している方法は、「なんちゃってRcmdrPlugin」の...
*参考資料 [#dbc9506e]
Writing R Extensions日本語訳(間瀬先生)~
http://www.is.titech.ac.jp/~mase/mase/R-exts.jp/R-exts.jp...
Writing R Extensions本家~
http://cran.r-project.org/doc/manuals/R-exts.html~
The R Commander: A Basic-Statistics GUI for R~
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/index.html~
Extending the R Commander by "Plug-In" Packages <=GOOD!~
http://tolstoy.newcastle.edu.au/R/e3/help/att-2806/wrappe...
~
RjpWiki内~
[[パッケージを作る]]~
[[私的パッケージ作成法]]~
[[Windowsでパッケージを自作]]~
[[Rから他言語利用]]~
*ビルドする環境の設定 [#i75d09b9]
Windowsでパッケージをビルドするためには、環境の設定が必要...
(注)過去のビルド環境設定の記事には「cygwin等のインスト...
**Rtoolsのインストール [#bd543018]
下記のサイトから利用しているRのバージョンに適合するRtools...
http://www.murdoch-sutherland.com/Rtools/~
~
#ref(rtools1.jpg)~
~
#ref(rtools3.jpg)~
~
#ref(rtools4.jpg)~
~
#ref(rtools5.jpg)~
パスが付加される。~
#ref(rtools6.jpg)~
~
#ref(rtools7.jpg)~
再起動する。~
**Microsoft HTML Help WorkShopのインストール [#zcc2ad9b]
下記のサイトからHtmlhelp.exeをダウンロードしてhhc.exeをイ...
http://msdn2.microsoft.com/en-us/library/ms669985.aspx~
~
#ref(hcc1.jpg)~
~
#ref(hcc2.jpg)~
~
#ref(hcc3.jpg)~
~
#ref(hcc4.jpg)~
Pathの設定をしてくれないので、後で設定が必要。~
**MikTexのインストール [#s3231d51]
http://www.miktex.org/~
#ref(miktex1.JPG)~
~
#ref(miktex2.JPG)~
~
#ref(miktex3.JPG)~
~
#ref(miktex4.JPG)~
~
#ref(miktex5.JPG)~
~
#ref(miktex6.JPG)~
~
#ref(miktex7.JPG)~
~
Pathは自動的に設定される。~
~
**Inno Setupのインストール [#ca760591]
http://jrsoftware.org/isinfo.php
(とりあえず保留)
*システム環境変数へのパスの設定 [#qbcdbd11]
XPでは[コントロールパネル][システム][詳細設定][環境変数][...
;C:\Program Files\R\R-2.5.1\bin
;C:\Program Files\HTML Help Workshop
この設定がきちんとできていないと、チェックやビルドの時に...
手動で設定するのが面倒な場合は、下記のツールを用意しまし...
(注)Path設定.wsfを何度も起動すると、いくつもPathが作られ...
#ref(Path設定.zip)~
(注意!)システム環境変数のPathを変更した場合は必ずOSを...
*ソースファイルの雛形の生成 [#qef78740]
*利用するコード~
#ref(makevector.r)~
makevector.rは舟尾さんの[[RCommanderハンドブック:http://w...
~
*利用するデータ~
#ref(inst.zip)~
inst.zipはダウンロード後解凍しておく~
まずRguiを起動し、
Vector <-function(){
initializeDialog(title="ベクトル生成")
Var1 <- tclVar("")
Var1Entry <- tkentry(top, width="6", textvariable=Var1)
Var2 <- tclVar("10")
Var2Entry <- tkentry(top, width="6", textvariable=Var2)
onOK <- function(){
closeDialog()
XXX <- as.numeric(tclvalue(Var1))
YYY <- as.numeric(tclvalue(Var2))
logger("ベクトルを生成します:")
command <- paste(XXX, ":", YYY, sep="")
doItAndPrint(command)
tkfocus(CommanderWindow())
}
OKCancelHelp(helpSubject="+")
tkgrid(tklabel(top, text=gettextRcmdr("引数1")), Var1En...
tkgrid(tklabel(top, text=gettextRcmdr("引数2")), Var2En...
tkgrid(buttonsFrame, columnspan=2, sticky="w")
tkgrid.configure(Var1Entry, sticky="w")
tkgrid.configure(Var2Entry, sticky="w")
dialogSuffix(rows=3, columns=2, focus=Var1Entry)
}
package.skeleton(name="RcmdrPlugin.makevector",path="c:/")
C:直下にRcmdrPlugin.makevectorフォルダが生成される
**各種ファイルの設定 [#i83d712c]
とりあえず省略(CRANに登録するならきちんと書く)
**menu.txtの置き場所 [#ke19627b]
#ref(folder1.JPG)
inst.zipをダウンロードし、解凍すると[inst][etc][menu.txt]...
RcmdrPlugin.makevectorフォルダ内に[inst]フォルダごと投入~
menu.txtがRCommanderのメニューになる~
*ソースファイルのチェック [#y43491c3]
Windowsのコマンド画面
#ref(rcmd1.JPG)
cd c:\
RCMD check RcmdrPlugin.makevector --no-examples
--no-examplesを指定しないと、exampleの作成をしようとし...
エラーにならなければOK
#ref(rcmd2.JPG)
チェックが進行し~
#ref(rcmd3.JPG)
チェック終了~
*ビルド実行 [#wb1b0662]
Windowsのコマンド画面
#ref(rcmd4.JPG)
RCMD build --binary RcmdrPlugin.makevector
#ref(rcmd5.JPG)
#ref(rcmd6.JPG)
RcmdrPlugin.makevector_1.0.zipが生成され、ビルドが終了...
--binary無しだと、tar.gzファイル(ソースファイル)が作...
エラーが発生した場合は、設定の何かが間違っているので最...
Pathの設定を特に確認すること~
*パッケージのインストール [#s071ce66]
RcmdrPlugin.makevectorパッケージのインストール
#ref(rgui2.JPG)
Rguiから[パッケージ][ローカルにあるzipファイルからのパ...
RcmdrPlugin.makevector_1.0.zipをインストールする~
インストールがうまくいかない場合はプログラムミスの可能...
*RCommanderの実行 [#w315546c]
#ref(RcmdrPlugin超入門/Rcmdr1.JPG,50%)
library(Rcmdr)
2度目以降は~
Commander()
RCommanderが起動したら、[ツール][Rcmdrプラグインのロー...
#ref(RcmdrPlugin超入門/Rcmdr2.JPG,50%)
RcmdrPlugin.makevectorを選択する~
#ref(RcmdrPlugin超入門/Rcmdr3.JPG,100%)
RCommanderが再起動して、~
#ref(RcmdrPlugin超入門/Rcmdr4.JPG,100%)
[ベクトル生成]メニューが追加される~
#ref(RcmdrPlugin超入門/Rcmdr5.JPG,50%)
実際に実行すると
#ref(RcmdrPlugin超入門/Rcmdr6.JPG,50%)
こうなる
#ref(RcmdrPlugin超入門/Rcmdr7.JPG,100%)
*パッケージのアンインストール [#u30230b3]
remove.packages("RcmdrPlugin.makevector")
*コメント欄 [#bfcb6c38]
- 有益なコンテンツの作成、どうもありがとうございました。...
C:\>cd c:\
C:\>RCMD check RcmdrPlugin.makevector --no-examples
* checking for working latex ... OK
* using log directory 'C:/RcmdrPlugin.makevector.Rcheck'
* using R version 2.6.1 (2007-11-26)
* checking for file 'RcmdrPlugin.makevector/DESCRIPTION'...
* checking extension type ... Package
* this is package 'RcmdrPlugin.makevector' version '1.0'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'RcmdrPlugin.makevector' can ...
Installation failed.
See 'C:/RcmdrPlugin.makevector.Rcheck/00install.out' for...
instフォルダのところで躓いている様なので、RCMD checkのと...
C:\>RCMD build --binary RcmdrPlugin.makevector
* checking for file 'RcmdrPlugin.makevector/DESCRIPTION'...
* preparing 'RcmdrPlugin.makevector':
* checking DESCRIPTION meta-information ... OK
* removing junk files
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building binary distribution
WARNING: some HTML links may not be found
installing R.css in C:/***************/Temp/Rinst174092147
Using auto-selected zip options ''
---------- Making package RcmdrPlugin.makevector -------...
adding build stamp to DESCRIPTION
installing R files
installing inst files
FIND: パラメータの書式が違います
make[2]: *** [C:/***************/Temp/Rinst174092147/Rcm...
makevector/inst] Error 2
make[1]: *** [all] Error 2
make: *** [pkg-RcmdrPlugin.makevector] Error 2
*** Installation of RcmdrPlugin.makevector failed ***
Removing 'C:/***************/Temp/Rinst174092147/RcmdrPl...
ERROR
* installation failed
環境設定の確認として、instフォルダを入れずに上記手順を実...
- チェック後のファイルRcmdrPlugin.makevector.Rcheckを見る...
- Pathが通っていることは確認出来ました。00install.outの中...
申し忘れましたが。。当方の環境はR 2.6.1です(R 2.6.0でも...
installing R.css in C:/RcmdrPlugin.makevector.Rcheck
---------- Making package RcmdrPlugin.makevector -------...
adding build stamp to DESCRIPTION
installing R files
installing inst files
FIND: パラメータの書式が違います
make[2]: *** [C:/RcmdrPlugin.makevector.Rcheck/RcmdrPlug...
make[1]: *** [all] Error 2
make: *** [pkg-RcmdrPlugin.makevector] Error 2
*** Installation of RcmdrPlugin.makevector failed ***
Removing 'C:/RcmdrPlugin.makevector.Rcheck/RcmdrPlugin.m...
- R2.6.1にしても残念ながらこちらでは再現できません。inst...
- instフォルダの中は、etcフォルダで、その中にmenu.txtがあ...
- Perlがいるのでは? -- &new{2007-12-20 (木) 15:58:27};
- RtoolsにVanilla Perlが入っていますので、いっしょにイン...
- ActivePerlは入れておりません。試しにActivePerlを入れて...
- Rtoolsとかを全て消去して、全て再インストールしたほうが...
- そうだ、Rのオブジェクトはまっさらな状態(オブジェクトを...
- はい、Rのオブジェクトはまっさらな状態(オブジェクトを全...
- 上の補足ですが、おそらく別のソフトと競合している可能性...
- 結局、どのソフトと競合しているかが分からず、OSを再イン...
ちなみに、最終的な環境はR2.5.1+WindowsXPです。 -- &new{2...
- 動作はしているのですが、引き続き調査しています。Microso...
- ああ、そうですね。Rのパスも似たようなもんですよね。 -- ...
- okinawa さん,非常に有益なコンテンツを作成いただきまし...
- おお!流石わかりやすくまとめられていますね。 -- [[okina...
- 初心者ですが、質問よろしいでしょうか。手順通りにやった...
- この記事は相当古いので、最近のものでやっても上手く行か...
- 了解です。いろいろと試してみます。 -- [[mami]] &new{201...
- 最新版でもいろいろ試してみてできました。そのまま実行す...
#comment
ここは[[okinawa]]が作成しました。~
アクセス数:
&counter;
人
終了行:
目次
#contents
*RcmdrPlugin超入門 [#vb0bf51c]
Rユーザー会2007でRcommanderのPluginの作り方を知りたい方...
ただし、Windows2000SP4,XPSP2上で作成する場合の方法ですの...
なお、Pluginの作成に当たっては舟尾さんの[[RCommanderハン...
(ここで公開している方法は、「なんちゃってRcmdrPlugin」の...
*参考資料 [#dbc9506e]
Writing R Extensions日本語訳(間瀬先生)~
http://www.is.titech.ac.jp/~mase/mase/R-exts.jp/R-exts.jp...
Writing R Extensions本家~
http://cran.r-project.org/doc/manuals/R-exts.html~
The R Commander: A Basic-Statistics GUI for R~
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/index.html~
Extending the R Commander by "Plug-In" Packages <=GOOD!~
http://tolstoy.newcastle.edu.au/R/e3/help/att-2806/wrappe...
~
RjpWiki内~
[[パッケージを作る]]~
[[私的パッケージ作成法]]~
[[Windowsでパッケージを自作]]~
[[Rから他言語利用]]~
*ビルドする環境の設定 [#i75d09b9]
Windowsでパッケージをビルドするためには、環境の設定が必要...
(注)過去のビルド環境設定の記事には「cygwin等のインスト...
**Rtoolsのインストール [#bd543018]
下記のサイトから利用しているRのバージョンに適合するRtools...
http://www.murdoch-sutherland.com/Rtools/~
~
#ref(rtools1.jpg)~
~
#ref(rtools3.jpg)~
~
#ref(rtools4.jpg)~
~
#ref(rtools5.jpg)~
パスが付加される。~
#ref(rtools6.jpg)~
~
#ref(rtools7.jpg)~
再起動する。~
**Microsoft HTML Help WorkShopのインストール [#zcc2ad9b]
下記のサイトからHtmlhelp.exeをダウンロードしてhhc.exeをイ...
http://msdn2.microsoft.com/en-us/library/ms669985.aspx~
~
#ref(hcc1.jpg)~
~
#ref(hcc2.jpg)~
~
#ref(hcc3.jpg)~
~
#ref(hcc4.jpg)~
Pathの設定をしてくれないので、後で設定が必要。~
**MikTexのインストール [#s3231d51]
http://www.miktex.org/~
#ref(miktex1.JPG)~
~
#ref(miktex2.JPG)~
~
#ref(miktex3.JPG)~
~
#ref(miktex4.JPG)~
~
#ref(miktex5.JPG)~
~
#ref(miktex6.JPG)~
~
#ref(miktex7.JPG)~
~
Pathは自動的に設定される。~
~
**Inno Setupのインストール [#ca760591]
http://jrsoftware.org/isinfo.php
(とりあえず保留)
*システム環境変数へのパスの設定 [#qbcdbd11]
XPでは[コントロールパネル][システム][詳細設定][環境変数][...
;C:\Program Files\R\R-2.5.1\bin
;C:\Program Files\HTML Help Workshop
この設定がきちんとできていないと、チェックやビルドの時に...
手動で設定するのが面倒な場合は、下記のツールを用意しまし...
(注)Path設定.wsfを何度も起動すると、いくつもPathが作られ...
#ref(Path設定.zip)~
(注意!)システム環境変数のPathを変更した場合は必ずOSを...
*ソースファイルの雛形の生成 [#qef78740]
*利用するコード~
#ref(makevector.r)~
makevector.rは舟尾さんの[[RCommanderハンドブック:http://w...
~
*利用するデータ~
#ref(inst.zip)~
inst.zipはダウンロード後解凍しておく~
まずRguiを起動し、
Vector <-function(){
initializeDialog(title="ベクトル生成")
Var1 <- tclVar("")
Var1Entry <- tkentry(top, width="6", textvariable=Var1)
Var2 <- tclVar("10")
Var2Entry <- tkentry(top, width="6", textvariable=Var2)
onOK <- function(){
closeDialog()
XXX <- as.numeric(tclvalue(Var1))
YYY <- as.numeric(tclvalue(Var2))
logger("ベクトルを生成します:")
command <- paste(XXX, ":", YYY, sep="")
doItAndPrint(command)
tkfocus(CommanderWindow())
}
OKCancelHelp(helpSubject="+")
tkgrid(tklabel(top, text=gettextRcmdr("引数1")), Var1En...
tkgrid(tklabel(top, text=gettextRcmdr("引数2")), Var2En...
tkgrid(buttonsFrame, columnspan=2, sticky="w")
tkgrid.configure(Var1Entry, sticky="w")
tkgrid.configure(Var2Entry, sticky="w")
dialogSuffix(rows=3, columns=2, focus=Var1Entry)
}
package.skeleton(name="RcmdrPlugin.makevector",path="c:/")
C:直下にRcmdrPlugin.makevectorフォルダが生成される
**各種ファイルの設定 [#i83d712c]
とりあえず省略(CRANに登録するならきちんと書く)
**menu.txtの置き場所 [#ke19627b]
#ref(folder1.JPG)
inst.zipをダウンロードし、解凍すると[inst][etc][menu.txt]...
RcmdrPlugin.makevectorフォルダ内に[inst]フォルダごと投入~
menu.txtがRCommanderのメニューになる~
*ソースファイルのチェック [#y43491c3]
Windowsのコマンド画面
#ref(rcmd1.JPG)
cd c:\
RCMD check RcmdrPlugin.makevector --no-examples
--no-examplesを指定しないと、exampleの作成をしようとし...
エラーにならなければOK
#ref(rcmd2.JPG)
チェックが進行し~
#ref(rcmd3.JPG)
チェック終了~
*ビルド実行 [#wb1b0662]
Windowsのコマンド画面
#ref(rcmd4.JPG)
RCMD build --binary RcmdrPlugin.makevector
#ref(rcmd5.JPG)
#ref(rcmd6.JPG)
RcmdrPlugin.makevector_1.0.zipが生成され、ビルドが終了...
--binary無しだと、tar.gzファイル(ソースファイル)が作...
エラーが発生した場合は、設定の何かが間違っているので最...
Pathの設定を特に確認すること~
*パッケージのインストール [#s071ce66]
RcmdrPlugin.makevectorパッケージのインストール
#ref(rgui2.JPG)
Rguiから[パッケージ][ローカルにあるzipファイルからのパ...
RcmdrPlugin.makevector_1.0.zipをインストールする~
インストールがうまくいかない場合はプログラムミスの可能...
*RCommanderの実行 [#w315546c]
#ref(RcmdrPlugin超入門/Rcmdr1.JPG,50%)
library(Rcmdr)
2度目以降は~
Commander()
RCommanderが起動したら、[ツール][Rcmdrプラグインのロー...
#ref(RcmdrPlugin超入門/Rcmdr2.JPG,50%)
RcmdrPlugin.makevectorを選択する~
#ref(RcmdrPlugin超入門/Rcmdr3.JPG,100%)
RCommanderが再起動して、~
#ref(RcmdrPlugin超入門/Rcmdr4.JPG,100%)
[ベクトル生成]メニューが追加される~
#ref(RcmdrPlugin超入門/Rcmdr5.JPG,50%)
実際に実行すると
#ref(RcmdrPlugin超入門/Rcmdr6.JPG,50%)
こうなる
#ref(RcmdrPlugin超入門/Rcmdr7.JPG,100%)
*パッケージのアンインストール [#u30230b3]
remove.packages("RcmdrPlugin.makevector")
*コメント欄 [#bfcb6c38]
- 有益なコンテンツの作成、どうもありがとうございました。...
C:\>cd c:\
C:\>RCMD check RcmdrPlugin.makevector --no-examples
* checking for working latex ... OK
* using log directory 'C:/RcmdrPlugin.makevector.Rcheck'
* using R version 2.6.1 (2007-11-26)
* checking for file 'RcmdrPlugin.makevector/DESCRIPTION'...
* checking extension type ... Package
* this is package 'RcmdrPlugin.makevector' version '1.0'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'RcmdrPlugin.makevector' can ...
Installation failed.
See 'C:/RcmdrPlugin.makevector.Rcheck/00install.out' for...
instフォルダのところで躓いている様なので、RCMD checkのと...
C:\>RCMD build --binary RcmdrPlugin.makevector
* checking for file 'RcmdrPlugin.makevector/DESCRIPTION'...
* preparing 'RcmdrPlugin.makevector':
* checking DESCRIPTION meta-information ... OK
* removing junk files
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building binary distribution
WARNING: some HTML links may not be found
installing R.css in C:/***************/Temp/Rinst174092147
Using auto-selected zip options ''
---------- Making package RcmdrPlugin.makevector -------...
adding build stamp to DESCRIPTION
installing R files
installing inst files
FIND: パラメータの書式が違います
make[2]: *** [C:/***************/Temp/Rinst174092147/Rcm...
makevector/inst] Error 2
make[1]: *** [all] Error 2
make: *** [pkg-RcmdrPlugin.makevector] Error 2
*** Installation of RcmdrPlugin.makevector failed ***
Removing 'C:/***************/Temp/Rinst174092147/RcmdrPl...
ERROR
* installation failed
環境設定の確認として、instフォルダを入れずに上記手順を実...
- チェック後のファイルRcmdrPlugin.makevector.Rcheckを見る...
- Pathが通っていることは確認出来ました。00install.outの中...
申し忘れましたが。。当方の環境はR 2.6.1です(R 2.6.0でも...
installing R.css in C:/RcmdrPlugin.makevector.Rcheck
---------- Making package RcmdrPlugin.makevector -------...
adding build stamp to DESCRIPTION
installing R files
installing inst files
FIND: パラメータの書式が違います
make[2]: *** [C:/RcmdrPlugin.makevector.Rcheck/RcmdrPlug...
make[1]: *** [all] Error 2
make: *** [pkg-RcmdrPlugin.makevector] Error 2
*** Installation of RcmdrPlugin.makevector failed ***
Removing 'C:/RcmdrPlugin.makevector.Rcheck/RcmdrPlugin.m...
- R2.6.1にしても残念ながらこちらでは再現できません。inst...
- instフォルダの中は、etcフォルダで、その中にmenu.txtがあ...
- Perlがいるのでは? -- &new{2007-12-20 (木) 15:58:27};
- RtoolsにVanilla Perlが入っていますので、いっしょにイン...
- ActivePerlは入れておりません。試しにActivePerlを入れて...
- Rtoolsとかを全て消去して、全て再インストールしたほうが...
- そうだ、Rのオブジェクトはまっさらな状態(オブジェクトを...
- はい、Rのオブジェクトはまっさらな状態(オブジェクトを全...
- 上の補足ですが、おそらく別のソフトと競合している可能性...
- 結局、どのソフトと競合しているかが分からず、OSを再イン...
ちなみに、最終的な環境はR2.5.1+WindowsXPです。 -- &new{2...
- 動作はしているのですが、引き続き調査しています。Microso...
- ああ、そうですね。Rのパスも似たようなもんですよね。 -- ...
- okinawa さん,非常に有益なコンテンツを作成いただきまし...
- おお!流石わかりやすくまとめられていますね。 -- [[okina...
- 初心者ですが、質問よろしいでしょうか。手順通りにやった...
- この記事は相当古いので、最近のものでやっても上手く行か...
- 了解です。いろいろと試してみます。 -- [[mami]] &new{201...
- 最新版でもいろいろ試してみてできました。そのまま実行す...
#comment
ここは[[okinawa]]が作成しました。~
アクセス数:
&counter;
人
ページ名: