不具合報告中継所
R で発見した種々の不具合について,しかるべき筋に報告してもらうために設ける中継所です。ここに書き込まれたことが,しかるべき筋に報告されるかどうかは,保証できません。
青木繁伸 (2007-10-24 (水) 15:00:49)
小規模なデータフレームHeight Weight BloodType 159 45 B 160 45 A 167 NA B 160 45 O 155 45 O 以下略(全部で60行)を使って,以下のようなもの
df <- read.table("idol.dat", header=TRUE) result <- split(df, df$BloodType) sapply(result, )をエディタで作っている途中に
2007-10-24 14:52:52.889 R[514] *** REngine.runREPL: caught ObjC exception in the main loop! *** Please report the following error on r-sig-mac@r-project.org along with the full description of how to reproduce it: *** reason: *** -[NSBigMutableString characterAtIndex:]: Range or index out of bounds *** name: NSRangeException, info: (null) *** Version: R 2.7.0 (43058) R.app R GUI 1.21-pre (devel 4798)/i386 Consider saving your work soon in case this problem leads to a full crash.と出て,エディタが反応しなくなりました。 その間,マウスを動かすと上のメッセージが繰り返し出るということに。
ただ,どのマシンでも再現するわけではないような。
akira (2007-10-15 (月) 11:32:43)
できれば元に戻してほしいなと思うこと
lowessをlibrary("gplots")するとエラーになります(detachするしかないのかなあ)> lowess(matrix(rnorm(10),ncol=2)) $x [1] -0.4870363380 -0.0000979089 0.5005777883 1.2403966227 1.6619158176 $y [1] -0.1656479 0.9996427 -2.0201375 -0.4005802 -0.4005802 > library("gplots") 要求されたパッケージ gtools をロード中です 要求されたパッケージ gdata をロード中です 次のパッケージを付け加えます: 'gplots' The following object(s) are masked from package:stats : lowess > lowess(matrix(rnorm(10),ncol=2)) 以下にエラー .C("lowess", x = as.double(xy$x[o]), as.double(xy$y[o]), n, as.double(f), : C シンボル名 "lowess" はパッケージ "base" の DLL の中にありません > detach("package:gplots") > lowess(matrix(rnorm(10),ncol=2)) $x [1] 0.2510234 0.2923961 0.4043872 0.4649510 1.5914308 $y [1] 0.05261158 -0.62864784 1.11317372 1.11317372 0.23452228RSiteSearchでは引っかかりませんでした。
akira (2007-10-15 (月) 10:38:02)
できれば元に戻してほしいなと思うこと
結構、使っているスクリプトなので修正が面倒なんです...
xがmatrixなら動きます> x <- matrix(1:12, ncol=3) > dimnames(x) <- list(LETTERS[1:4], letters[1:3]) > x a b c A 1 5 9 B 2 6 10 C 3 7 11 D 4 8 12 > x[rownames(x)=="A", ] a b c 1 5 9 > x[, colnames(x)=="a"] A B C D 1 2 3 4 > x[rownames(x)=="A", colnames(x)=="a"] [1] 1でも、xがdata.frameになるとエラーになります
> x <- data.frame(x) > x a b c A 1 5 9 B 2 6 10 C 3 7 11 D 4 8 12 > x[rownames(x)=="A", ] a b c A 1 5 9 > x[, colnames(x)=="a"] [1] 1 2 3 4 > x[rownames(x)=="A", colnames(x)=="a"] 以下にエラー .subset2(xx, j) : 再帰的な添字操作がレベル 2 で失敗しましたR-2.5.1まではちゃんと動いていたのですが...
青木繁伸 (2007-10-05 (金) 16:43:04)
ときどき出ます。何種類かあると思いますが,今出たのは以下のもの。
何らかの参考になりますでしょうか?
2007-10-05 16:25:59.144 R[669] -[NSBigMutableString characterAtIndex:] called with out-of-bounds index. For apps linked on Tiger this will raise an exception. For earlier apps it will produce this one-time warning and continue with existing behavior (which is undefined).> sessionInfo() R version 2.6.0 Patched (2007-10-03 r43075) i386-apple-darwin8.10.1 locale: ja_JP.UTF-8/ja_JP.UTF-8/ja_JP.UTF-8/C/ja_JP.UTF-8/ja_JP.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.6.0
アール (2006-10-26 (木) 18:28:54)
R 2.4.0 から,plot=FALSE のときに見当違いの warning を出すようになった。> x <- 1:10 > ans1 <- hist(x, right=FALSE, plot=FALSE) Warning message: argument ‘right’ is not made use of in: hist.default(x, right = FALSE, plot = FALSE) > ans1$counts [1] 1 2 2 2 3 > ans2 <- hist(x, right=TRUE, plot=FALSE) Warning message: argument ‘right’ is not made use of in: hist.default(x, right = TRUE, plot = FALSE) > ans2$counts [1] 2 2 2 2 2結果が違うんだから(そのように指定したのだが),この warning はおかしい。
nf <- nf[is.na(match(nf, c("x", "breaks", "freq", "nclass", "plot", "probability", "right", "include.lowest")))]
nf <- nf[is.na(match(nf, c("x", "breaks", "freq", "nclass", "plot", "probability")))]になったけど,このリストに,right も入れるべきではないかなぁ。
アール (2006-09-01 (金) 10:34:22)
データファイルを用意するとき,変数名が日本語でその中に半角ピリオドが含まれるとき,変数名がアルファベットでその中に半角ピリオドが含まれるときと扱いが異なります。> df <- read.table("name.dat", header=TRUE) > df 身長.1 体重 BMI.2 1 157.3 50.6 20.4 2 153.8 53.5 22.6 3 167.0 60.0 21.5 4 155.0 58.0 24.1 5 167.2 NA NA 6 156.5 46.0 18.8 7 157.5 59.5 24.0 8 151.0 65.0 28.5 9 158.5 58.0 23.1 10 157.3 46.0 18.6 > df$身長.1 + # しょうがないので,ここでリターンキーを押しました NULL > df$"身長.1" [1] 157.3 153.8 167.0 155.0 167.2 156.5 157.5 151.0 158.5 [10] 157.3 > df$BMI.2 [1] 20.4 22.6 21.5 24.1 NA 18.8 24.0 28.5 23.1 18.6 > df$"BMI.2" [1] 20.4 22.6 21.5 24.1 NA 18.8 24.0 28.5 23.1 18.6環境は,Macintosh OS X 10.4.7, R 2.3.1 です。~
また,データフレームを作るときにもちょっと変な感じです。> df <- data.frame(Var.1 <- 1:10, 変数.2 <- 11:20) > df Var.1....1.10 X.変数.2......11.20 1 1 11 2 2 12 以下略 > df <- data.frame("Var.1" <- 1:10, "変数.2" <- 11:20) > df X.Var.1.....1.10 X.変数.2.....11.20 1 1 11 2 2 12 以下略 > df <- data.frame("Var.1" <- 1:10, "変数.2" <- 11:20, etc=21:30) > df X.Var.1.....1.10 X.変数.2.....11.20 etc 1 1 11 21 2 2 12 22 以下略
> df <- data.frame(Var.1 = 1:10, 変数.2 = 11:20) > df Var.1 変数.2. 1 1 11 2 2 12
アール (2006-02-02 (木) 23:27:53)
Q&A (初級者コース)の「 read.fortran での入力行数」
と,書いてあった,,,んだが,
いつの間にかなくなっている。。。ので,新たに,書いておこうかな。
read.fortran は read.fwf を呼ぶのだが,後者には引数 buffersize=2000 というのがあるが(デフォルトが2000),前者には対応する引数はない。
この引数は,「一度に読みこむ行数」に関係している。
で,read.fortran の利用者は,「なんで,2000行しか読んでくれないんだ?」と思うかもしれない。オンラインヘルプを見ても,そんな制限は書いていなくて,ソースをみて read.fwf 関数のオンラインヘルプを見て始めて,「そんなことはもっと早く言ってくれ」ということになりはしないか。