看板Statistics
标 题Re: [问题]R 2.4.0
发信站无名小站 (Thu Nov 9 10:14:22 2006)
转信站ptt!Group.NCTU!grouppost!Group.NCTU!wretch
※ 引述《wwfc》之铭言:
> 最近安装了R 2.4.0,却发现它的help变成html形式,
这只是因为 2.4.0 的安装程序中提供了个选项设定的程序,
而其内设的 help 是采用了 html 的格式.
有人误以为是 R 有了新东西, 其实不是.
在 R 里一共有 3 种格式来呈现 on-line help:
window, html, 与 chtml (complied html).
事实上还有第四种格式: LaTeX 的,
只是这种格式是为了提供 on-line 而作.
如果印象没错的话, R 在一开始就有这些!
进入放 R 的目录 (资料夹) 下的 library 里,
点选任一个 package, 就可看到
help (window 版), html, chtml, 与 latex
四个子目录, 就是存放这些版本的地方.
> 打 help("topic"),会跳出该topic的help网页,
> 不是之前版本的模式,虽然说内容一样,但是总用不习惯,
> 想请问一下要怎麽设定,才能让它回到之前的形式?
On-line help 的格式设定是由 R 目录下, etc 子目录中的
Rprofile.site
(纯文字档案, 可用任一编辑软体开启, 但在回存时仍应是纯文字格式)
中来作设定.
例如我的 Rprofile.site 的内容是
---
1 # Things you might want to change
2
3 # options(papersize="a4")
4 # options(editor="notepad")
5 # options(pager="internal")
6
7 # to prefer Compiled HTML help
8 # options(chmhelp=TRUE)
9
10 # to prefer HTML help
11 # options(htmlhelp=TRUE)
12
13 options(digits=4, show.signif.stars=FALSE)
---
(开头的数字序号 [行号] 是我在此加上去以便於说明之用)
因为行 8 与行 11 前都有个 # (comment, 注记符号),
使得 help 的格式是 window. (排除法的运用)
除非是使用 XEmacs + ESS 来使用 R,
我个人建议将行 8 开头的 # 删除,
使用 chtml (complied html) 的版本.
以此类推, 若想要使用以电脑中内设的浏览器来开启 on-line help,
那麽就是将行 11 开头的 # 删除.
行 13 是我个人的偏好设定
(附在此顺便说明这 Rprofile.site 可如何利用)
这是以 options() 来更动内设的 options settings
(上述 on-line help 版本的设定也是由此来更动)
digits = 4 是设定在呈现数值资料时, 原则上是以四位显着位数来呈现,
原先内设是 digits = 7.
show.signif.stars=FALSE 是在列印摘要整理的参数估计表
(summary tables of coefficients) 时, 不列出星星 (stars) 注记,
这选项的预设是 TRUE (会列印)
例如:
> summary(lm(Volume ~ ., data=trees))
Call:
lm(formula = Volume ~ ., data = trees)
Residuals:
Min 1Q Median 3Q Max
-6.406 -2.649 -0.288 2.200 8.485
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -57.988 8.638 -6.71 2.7e-07
Girth 4.708 0.264 17.82 < 2e-16
Height 0.339 0.130 2.61 0.014
Residual standard error: 3.88 on 28 degrees of freedom
Multiple R-Squared: 0.948, Adjusted R-squared: 0.944
F-statistic: 255 on 2 and 28 DF, p-value: <2e-16
还原回原先内设值: TRUE
> options(show.signif.stars=TRUE)
> summary(lm(Volume ~ ., data=trees))
Call:
lm(formula = Volume ~ ., data = trees)
Residuals:
Min 1Q Median 3Q Max
-6.406 -2.649 -0.288 2.200 8.485
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -57.988 8.638 -6.71 2.7e-07 ***
Girth 4.708 0.264 17.82 < 2e-16 ***
Height 0.339 0.130 2.61 0.014 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.88 on 28 degrees of freedom
Multiple R-Squared: 0.948, Adjusted R-squared: 0.944
F-statistic: 255 on 2 and 28 DF, p-value: <2e-16
-----
希望这'借题发挥'没有'弄巧成拙'才好!
--
cjlu 在
06/11/09 10:14:22 从
140.116.152.108 修改这篇文章