2

可能是史上最强更新:R 2.13.0

 3 years ago
source link: https://yihui.org/cn/2011/04/r-updated-to-2-13-0/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

可能是史上最强更新:R 2.13.0

谢益辉 / 2011-04-13


R 2.13.0 今日出炉,一大批更新中有以下条目吸引了我的眼球:

  • image () has gained a logical useRaster argument allowing it to use a bitmap raster for plotting a regular grid instead of polygons. This can be more efficient, but may not be supported by all devices. The default is FALSE. 不知道 tikzDevice 能否正确处理,如果可以的话,也许可以放心使用 image () 了,之前由于 tikz 生成的 image () 的图形既大(因为是很多矩形)又有难看的白色网格,所以让我一直很纠结。

  • file.copy () now (by default) copies read/write/execute permissions on files, moderated by the current setting of Sys.umask (). 这个问题貌似是我报告过的,因为 roxygen 拷贝 configure 文件的时候会把 744 属性丢失。

  • New hook “before.new.plot” allows functions to be run just before advancing the frame in plot.new, which is potentially useful for custom figure layout implementations. 这让我们可以在.Rprofile 文件中设定默认的 par (),免得每幅图都要 par () 来 par () 去的。

  • Package tools has a new function compactPDF() to try to reduce the size of PDF files via qpdf or gs. 这 qpdf 貌似也是我推荐的,主要是因为 Sweave 默认用 PDF 图形,而这些 PDF 图形都是没有经过压缩的,所以导致包的体积不必要地大。

  • file.rename () now allows vector arguments (of the same length). 省去了循环。

  • Package compiler is now provided as a standard package. See ?compiler::compile for information on how to use the compiler. This package implements a byte code compiler for R: by default the compiler is not used in this release. See the ‘R Installation and Administration Manual’ for how to compile the base and recommended packages. 也许有人在 Google Reader 中看到了我的分享,这是 Luke Tierney 十几年的工作,终于浮出了水面,此举也许能让 R 的运算速度加快几倍。如果自己通过 make install 的方式安装,可以先 make bytecode,回头测试一下速度。

  • Sweave () has options to produce PNG and JPEG figures, and to use a custom function to open a graphics device (see ?RweaveLatex). (Based in part on the contribution of PR#14418.) 这是我们抱怨了无数遍的一点:Sweave 不能使用除了 PDF 和 Postscript 之外的图形。在 2.14.0 中这个问题将进一步得到解决,到时候可以任意自定义图形设备。

  • The default for Sweave () is to produce only PDF figures (rather than both EPS and PDF). 我早说了,这年头有谁还会用老旧的 EPS 图形啊?2.14.0 的时候,一段 Sweave 代码只会被执行一遍,这也是我期待很久的特征。

  • If there is a field BuildVignettes in the package DESCRIPTION file with a false value, re-building the vignettes is skipped. 此举可节省 R 包安装时间,尤其是有大的 vignette 或者其中有 CRAN 的环境无法编译的代码。

  • File R.css is now installed on a per-package basis (in the package’s html directory) rather than in each library tree, and this is used for all the HTML pages in the package. This helps when installing packages with static HTML pages for use on a webserver. It will also allow future versions of R to use different stylesheets for the packages they install. 同样是抱怨过的问题,R 默认的 css 太丑了,现在包的开发者终于可以自定义 R.css 了。

  • The gamma argument to hsv (), rainbow (), and rgb2hsv () is deprecated and no longer has any effect. 对我写书有一点小影响,不过我早已经更新这些函数在书中的说明。

总的说来,还是 compiler 包看起来是最大的更新。

外一篇:一年一度的 John Chambers 奖

今年的 Chambers 奖只收到很少几件作品,最终 Ian Fellows 的 Deducer 胜出(我又剧透了),尽管我总觉得这玩意儿做得不够优雅。

又及:当年 Chambers 大人捐赠的奖金只有 1 万刀,某大佬曾抱怨说,这钱早就花光了!不知道 ASA 是怎样维持的。

Tufte 样式,纠结了 第四届中国 R 语言会议

Disqus Utterances Preferences

© Yihui Xie 2005 - 2020

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK