トップ
新規
一覧
単語検索
最終更新
ヘルプ
ログイン
アールメカブ
R_old_tips3
をテンプレートにして作成
開始行:
[[R_old_tips2]]
[[Rサーチ:http://seekr.jp/]]
[[R関係のスライドやビデオ>R_Slide_Video]]
# $ fc-list : family
# $ xlsfonts -fn -ipamona-gothic-*-*-*-*-*-*-*-*-*-*-*-*
grDevices::X11.options(
fonts=c("-ipamona-gothic-*-*-*-*-*-*-*-*-*-*-*-*", ##...
"-adobe-symbol-medium-r-*-*-%d-*-...
grDevices::pdf.options(family="Japan1GothicBBB")
grDevices::ps.options(family="Japan1GothicBBB")
// grDevices::X11.options(fonts = c("-*-gothic-%s-%s-norm...
// "-adobe-symbol-*-*-*-*-%d-*-*-*-*-*-*-*"))
//ps.options(family= "Japan1")# 2010 06 01 Ubuntu 10.04
//sazanamiがいやんばかんと言うことだったと思いますので, I...
///KozMinPro-Regular-Acro << /FileType /TrueType /Path (/...
//みたいに記述すれば良いと思います. -
#contents
//http://gensen.dl.itc.u-tokyo.ac.jp/
//http://cse.niaes.affrc.go.jp/miwa/ja/R/setup290/index.h...
//http://www2.hyo-med.ac.jp/~tanimura/R/R.html
* 自作パッケージ [#x2383529]
- &size(20){&color(blue){[[RMeCab]]パッケージ};};
データ解析・グラフィックス環境 &size(18){[[R:http://cran....
-- [[R2MeCab]] :[[RMeCab]]のサブセット.実装関数は三つだ...
-&size(20){&color(blue){[[RCaBoCha]]パッケージ};};
データ解析・グラフィックス環境 &size(18){[[R:http://cran....
//** [[R_source>RSource]] [#p537302d]
* Rを最新版にした結果、RExcel が起動しなくなった場合 [#p...
R を管理者権限で実行し
+ R のメニュー パッケージ を使って Rcmdr をインスト...
+ R のメニュー パッケージ を使って RExcelInstaller ...
+ library(RExcelInstaller) を実行
+ installRExcel() を実行する
+ Setup ウイザードの指示に従って next, install をクリ...
+ 念のため RExcel を管理者権限で実行
以上です
RExcel を含め、古いRにインストールしていたパッケージをす...
http://sunsite.univie.ac.at/rcom/
トップメニュー Wiki -> 左フレーム How to upgrade R wi...
その他,[[中澤先生のサイト:http://phi.med.gunma-u.ac.jp/s...
* [[RExcel]] [#ve2b7ff1]
* R の参考書 [#b1682569]
//&htmlinsert(amazontext,asin=,text=);
-&htmlinsert(amazontext,asin=4627848412,text=『Rによるテ...
-&htmlinsert(amazontext,asin=4431712186,text=U・リゲス著...
-&htmlinsert(amazontext,asin=4431713123,text=B・エヴェリ...
-&htmlinsert(amazontext,asin=4431100474,text=P・スペクタ...
-&htmlinsert(amazontext,asin=4274067572,text=青木繁伸『R...
- &htmlinsert(amazontext,asin=4627096011,text=金明哲『Rに...
- &htmlinsert(amazontext,asin=4777511847,text=舟尾暢男『...
-&htmlinsert(amazontext,asin=4894717573,text=中澤港『Rに...
* 資料 [#sb73f487]
- [[統計数理研究所公開講座:http://www.ism.ac.jp/lectures/...
準備途上 Windows 用実行ファイル &ref(ism20091124.R);
-第91回行動計量シンポジウム &ref(管理者/TextMining2.pdf);
-行動計量学会第35回全国大会 関係 (チュートリアルpdf &ref(...
//&発表pdf):http://150.59.18.68/]]
-[[統計的言語処理]]
- ラプラス近似.[[ここによいメモ:http://d.hatena.ne.jp/tr...
--------------------------------
&size(22){R についての最近のメモ};
//CENTER:&size(22){&color(red){R を使い始めた頃からのメモ...
////////////////////////////////
//////////////////////////////
//-[[R_入力ソースの判定]]
*************** [#g26842d3]
*[[RとEmacsとGDBでデバッグ>http://rmecab.jp/new/?p=413]] ...
*[[Rcpp]] [#v4afd978]
*[[Rcpp_DataFrame]] [#w5039e37]
* Rの正規表現で URL 抽出. [#o3492630]
とりあえず,手っ取り早くこんなもん.ただし,抽出できない...
str <- "これはhttp://cran.r-project.org/で,あれはhttp:/...
tmp <- gregexpr ("https?://.+/(.+/)*?", str)
substring(str, tmp[[1]], tmp[[1]] + attr (tmp[[1]], 'ma...
*[[Rでシフト演算>R_Shift]] [#y94fde7b]
*[[animation]] [#e350c871]
* [[RHIPE - R and Hadoop Integrated Processing Environmen...
* [[Putting Robust Standard Errors into LaTeX Tables An E...
* [[Building and checking R source packages for Windows:h...
*[[R 2.12 to 2.13 package upgrade:http://www.r-bloggers.c...
*[[How to upgrade R on windows 7:http://www.r-bloggers.co...
*[[Server版RStudio Ubuntu]] [#zd988f76]
*[[分割表をもとのデータに>ConvertTableToRawData]] [#k402a...
*[[Rで曜日と月の数を数える:]] [#jb3978bd]
*[[CRANberries:http://dirk.eddelbuettel.com/blog/2011/01/...
*[[zapsmall]] [#j74a01f9]
*[[R_Connection]] [#x84cba65]
*[[R_sqLite_Excel]] [#y7e7d66e]
*[[if_else]] [#r32eaf2c]
*[[rawToChar]] [#v9ecf77e]
*[[Unicode_utf8]] [#f06a440a]
*[[ReferenceClasses]] [#l6ddcd31]
とりあえず[[ここを参考:http://www.inside-r.org/r-doc/meth...
## a simple editor for matrix objects. Method $edit() ...
## range of values; method $undo() undoes the last edit.
mEditor <- setRefClass("matrixEditor",
fields = list( data = "matrix",
edits = "list"),
methods = list(
edit = function(i, j, value) {
## the following string documents the edit method
'Replaces the range [i, j] of the
object by value.
'
backup <-
list(i, j, data[i,j])
data[i,j] <<- value
edits <<- c(list(backup),
edits)
invisible(value)
},
undo = function() {
'Undoes the last edit() operation
and update the edits field accordingly.
'
prev <- edits
if(length(prev)) prev <- prev[[1]]
else stop("No more edits to undo")
edit(prev[[1]], prev[[2]], prev[[3]])
## trim the edits list
length(edits) <<- length(edits) - 2
invisible(prev)
}
))
xMat <- matrix(1:12,4,3)
xx <- mEditor$new(data = xMat)
xx$edit(2, 2, 0)
xx$data
xx$undo()
mEditor$help("undo")
stopifnot(all.equal(xx$data, xMat))
## add a method to save the object
mEditor$methods(
save = function(file) {
'Save the current object on the file
in R external object format.
'
base::save(.self, file = file)
}
)
tf <- tempfile()
xx$save(tf) #$
*[[Rcpp]] [#i282f9f6]
*[[疎行列を作成する>Sparse_Document_Term_Matrix]] [#jba11...
* [[boxplot]] [#l2d153b8]
* 適合度の検定における最小期待値 [#i53dc7f0]
期待値が5未満のセルが20%あるといけないなどというが,一度...
* CS3とEPS [#o03d3f54]
Rで作成した日本語入りEPSを, Windows の CS3 で確実に読みこ...
library(Cairo)
CairoFonts(
regular="IPA P明朝,IPAPMincho:style=Regular",
bold="IPA Pゴシック,IPAPGothic:style=Regular,Bold",
italic="IPA P明朝,IPAPMincho:style=Regular,Italic",
bolditalic="IPA Pゴシック,IPAPGothic:style=Regular,Bol...
CairoPS(file = "/home/ishida/cairo.ps", bg="white")
plot(1:10, 1:10, main ="テスト", cex = 1.2)
dev.off()
embedFonts(file ="~/cairo.ps", outfile ="~/Cairo2.eps" )
としておく.[[ここ>R_fromOldHtml3#nc4d8299]]も参照
* PDF [#j326112e]
根本的解決に至っていないが R 上で日本語を含む PDF を作成...
とりあえず
library(Cairo)
# CairoFonts(regular="VL ゴシック,VL Gothic:style=regula...
CairoFonts(regular="IPA P明朝,IPAPMincho:style=Regular")
CairoPS(file = "Fig", bg="white")
hogehoge
dev.off()
として ps を作成し,変換しておく
* RCurl [#t0c8b845]
twitteR のインストールに必要だが,'curl' と 'libcurl3 に加...
$ apt-cache search libcurl3-dev
libcurl4-openssl-dev - Development files and documentati...
$ apt-get install libcurl4-openssl-dev
[[ここ:https://stat.ethz.ch/pipermail/r-help/2007-October...
* if の返り値 [#y0541570]
x <- 0
y <- if(x + 1){
x + 100
}else{
x - 100
}
y
[1] 100
#
y <- if(x + 1) cat("TRUE\n")# else cat("FALSE\n")
if(y <- x + 1) cat("TRUE\n") else cat("FALSE\n")
* lme による分散成分の標準誤差 [#z6bda2d5]
-- Rjpwikiに lme の出力から分散成分の標準誤差を取り出した...
* .Primitives [#p4ecb1dd]
2校演算子の定義するためにはクオートするが,呼び出しは以下...
> str(`*`)
function (e1, e2)
> get("*")
function (e1, e2) .Primitive("*")
> `*`(3,3)
[1] 9
> get("*")
function (e1, e2) .Primitive("*")
> "*"(3,3)
[1] 9
> `like this` <- 2
> "like that" <- 3
> print(`like this`)
[1] 2
> print("like that")
[1] "like that"
[[R-helpより:http://www.mail-archive.com/r-help@stat.math...
*[[Cairo]] [#g9b156f4]
終了行:
[[R_old_tips2]]
[[Rサーチ:http://seekr.jp/]]
[[R関係のスライドやビデオ>R_Slide_Video]]
# $ fc-list : family
# $ xlsfonts -fn -ipamona-gothic-*-*-*-*-*-*-*-*-*-*-*-*
grDevices::X11.options(
fonts=c("-ipamona-gothic-*-*-*-*-*-*-*-*-*-*-*-*", ##...
"-adobe-symbol-medium-r-*-*-%d-*-...
grDevices::pdf.options(family="Japan1GothicBBB")
grDevices::ps.options(family="Japan1GothicBBB")
// grDevices::X11.options(fonts = c("-*-gothic-%s-%s-norm...
// "-adobe-symbol-*-*-*-*-%d-*-*-*-*-*-*-*"))
//ps.options(family= "Japan1")# 2010 06 01 Ubuntu 10.04
//sazanamiがいやんばかんと言うことだったと思いますので, I...
///KozMinPro-Regular-Acro << /FileType /TrueType /Path (/...
//みたいに記述すれば良いと思います. -
#contents
//http://gensen.dl.itc.u-tokyo.ac.jp/
//http://cse.niaes.affrc.go.jp/miwa/ja/R/setup290/index.h...
//http://www2.hyo-med.ac.jp/~tanimura/R/R.html
* 自作パッケージ [#x2383529]
- &size(20){&color(blue){[[RMeCab]]パッケージ};};
データ解析・グラフィックス環境 &size(18){[[R:http://cran....
-- [[R2MeCab]] :[[RMeCab]]のサブセット.実装関数は三つだ...
-&size(20){&color(blue){[[RCaBoCha]]パッケージ};};
データ解析・グラフィックス環境 &size(18){[[R:http://cran....
//** [[R_source>RSource]] [#p537302d]
* Rを最新版にした結果、RExcel が起動しなくなった場合 [#p...
R を管理者権限で実行し
+ R のメニュー パッケージ を使って Rcmdr をインスト...
+ R のメニュー パッケージ を使って RExcelInstaller ...
+ library(RExcelInstaller) を実行
+ installRExcel() を実行する
+ Setup ウイザードの指示に従って next, install をクリ...
+ 念のため RExcel を管理者権限で実行
以上です
RExcel を含め、古いRにインストールしていたパッケージをす...
http://sunsite.univie.ac.at/rcom/
トップメニュー Wiki -> 左フレーム How to upgrade R wi...
その他,[[中澤先生のサイト:http://phi.med.gunma-u.ac.jp/s...
* [[RExcel]] [#ve2b7ff1]
* R の参考書 [#b1682569]
//&htmlinsert(amazontext,asin=,text=);
-&htmlinsert(amazontext,asin=4627848412,text=『Rによるテ...
-&htmlinsert(amazontext,asin=4431712186,text=U・リゲス著...
-&htmlinsert(amazontext,asin=4431713123,text=B・エヴェリ...
-&htmlinsert(amazontext,asin=4431100474,text=P・スペクタ...
-&htmlinsert(amazontext,asin=4274067572,text=青木繁伸『R...
- &htmlinsert(amazontext,asin=4627096011,text=金明哲『Rに...
- &htmlinsert(amazontext,asin=4777511847,text=舟尾暢男『...
-&htmlinsert(amazontext,asin=4894717573,text=中澤港『Rに...
* 資料 [#sb73f487]
- [[統計数理研究所公開講座:http://www.ism.ac.jp/lectures/...
準備途上 Windows 用実行ファイル &ref(ism20091124.R);
-第91回行動計量シンポジウム &ref(管理者/TextMining2.pdf);
-行動計量学会第35回全国大会 関係 (チュートリアルpdf &ref(...
//&発表pdf):http://150.59.18.68/]]
-[[統計的言語処理]]
- ラプラス近似.[[ここによいメモ:http://d.hatena.ne.jp/tr...
--------------------------------
&size(22){R についての最近のメモ};
//CENTER:&size(22){&color(red){R を使い始めた頃からのメモ...
////////////////////////////////
//////////////////////////////
//-[[R_入力ソースの判定]]
*************** [#g26842d3]
*[[RとEmacsとGDBでデバッグ>http://rmecab.jp/new/?p=413]] ...
*[[Rcpp]] [#v4afd978]
*[[Rcpp_DataFrame]] [#w5039e37]
* Rの正規表現で URL 抽出. [#o3492630]
とりあえず,手っ取り早くこんなもん.ただし,抽出できない...
str <- "これはhttp://cran.r-project.org/で,あれはhttp:/...
tmp <- gregexpr ("https?://.+/(.+/)*?", str)
substring(str, tmp[[1]], tmp[[1]] + attr (tmp[[1]], 'ma...
*[[Rでシフト演算>R_Shift]] [#y94fde7b]
*[[animation]] [#e350c871]
* [[RHIPE - R and Hadoop Integrated Processing Environmen...
* [[Putting Robust Standard Errors into LaTeX Tables An E...
* [[Building and checking R source packages for Windows:h...
*[[R 2.12 to 2.13 package upgrade:http://www.r-bloggers.c...
*[[How to upgrade R on windows 7:http://www.r-bloggers.co...
*[[Server版RStudio Ubuntu]] [#zd988f76]
*[[分割表をもとのデータに>ConvertTableToRawData]] [#k402a...
*[[Rで曜日と月の数を数える:]] [#jb3978bd]
*[[CRANberries:http://dirk.eddelbuettel.com/blog/2011/01/...
*[[zapsmall]] [#j74a01f9]
*[[R_Connection]] [#x84cba65]
*[[R_sqLite_Excel]] [#y7e7d66e]
*[[if_else]] [#r32eaf2c]
*[[rawToChar]] [#v9ecf77e]
*[[Unicode_utf8]] [#f06a440a]
*[[ReferenceClasses]] [#l6ddcd31]
とりあえず[[ここを参考:http://www.inside-r.org/r-doc/meth...
## a simple editor for matrix objects. Method $edit() ...
## range of values; method $undo() undoes the last edit.
mEditor <- setRefClass("matrixEditor",
fields = list( data = "matrix",
edits = "list"),
methods = list(
edit = function(i, j, value) {
## the following string documents the edit method
'Replaces the range [i, j] of the
object by value.
'
backup <-
list(i, j, data[i,j])
data[i,j] <<- value
edits <<- c(list(backup),
edits)
invisible(value)
},
undo = function() {
'Undoes the last edit() operation
and update the edits field accordingly.
'
prev <- edits
if(length(prev)) prev <- prev[[1]]
else stop("No more edits to undo")
edit(prev[[1]], prev[[2]], prev[[3]])
## trim the edits list
length(edits) <<- length(edits) - 2
invisible(prev)
}
))
xMat <- matrix(1:12,4,3)
xx <- mEditor$new(data = xMat)
xx$edit(2, 2, 0)
xx$data
xx$undo()
mEditor$help("undo")
stopifnot(all.equal(xx$data, xMat))
## add a method to save the object
mEditor$methods(
save = function(file) {
'Save the current object on the file
in R external object format.
'
base::save(.self, file = file)
}
)
tf <- tempfile()
xx$save(tf) #$
*[[Rcpp]] [#i282f9f6]
*[[疎行列を作成する>Sparse_Document_Term_Matrix]] [#jba11...
* [[boxplot]] [#l2d153b8]
* 適合度の検定における最小期待値 [#i53dc7f0]
期待値が5未満のセルが20%あるといけないなどというが,一度...
* CS3とEPS [#o03d3f54]
Rで作成した日本語入りEPSを, Windows の CS3 で確実に読みこ...
library(Cairo)
CairoFonts(
regular="IPA P明朝,IPAPMincho:style=Regular",
bold="IPA Pゴシック,IPAPGothic:style=Regular,Bold",
italic="IPA P明朝,IPAPMincho:style=Regular,Italic",
bolditalic="IPA Pゴシック,IPAPGothic:style=Regular,Bol...
CairoPS(file = "/home/ishida/cairo.ps", bg="white")
plot(1:10, 1:10, main ="テスト", cex = 1.2)
dev.off()
embedFonts(file ="~/cairo.ps", outfile ="~/Cairo2.eps" )
としておく.[[ここ>R_fromOldHtml3#nc4d8299]]も参照
* PDF [#j326112e]
根本的解決に至っていないが R 上で日本語を含む PDF を作成...
とりあえず
library(Cairo)
# CairoFonts(regular="VL ゴシック,VL Gothic:style=regula...
CairoFonts(regular="IPA P明朝,IPAPMincho:style=Regular")
CairoPS(file = "Fig", bg="white")
hogehoge
dev.off()
として ps を作成し,変換しておく
* RCurl [#t0c8b845]
twitteR のインストールに必要だが,'curl' と 'libcurl3 に加...
$ apt-cache search libcurl3-dev
libcurl4-openssl-dev - Development files and documentati...
$ apt-get install libcurl4-openssl-dev
[[ここ:https://stat.ethz.ch/pipermail/r-help/2007-October...
* if の返り値 [#y0541570]
x <- 0
y <- if(x + 1){
x + 100
}else{
x - 100
}
y
[1] 100
#
y <- if(x + 1) cat("TRUE\n")# else cat("FALSE\n")
if(y <- x + 1) cat("TRUE\n") else cat("FALSE\n")
* lme による分散成分の標準誤差 [#z6bda2d5]
-- Rjpwikiに lme の出力から分散成分の標準誤差を取り出した...
* .Primitives [#p4ecb1dd]
2校演算子の定義するためにはクオートするが,呼び出しは以下...
> str(`*`)
function (e1, e2)
> get("*")
function (e1, e2) .Primitive("*")
> `*`(3,3)
[1] 9
> get("*")
function (e1, e2) .Primitive("*")
> "*"(3,3)
[1] 9
> `like this` <- 2
> "like that" <- 3
> print(`like this`)
[1] 2
> print("like that")
[1] "like that"
[[R-helpより:http://www.mail-archive.com/r-help@stat.math...
*[[Cairo]] [#g9b156f4]
ページ名: