KuboWeb top

更新: 2012-09-24 21:50:27

生態学のデータ解析 - R-2.9.0 の News

  • 本/R Graphics の翻訳のために,R-2.9.0 の NEWS をごくごくいいかげんに抜粋してみた
    • もとのファイル: r-NEWS-2.9.0.txt (一万行ちかい巨大なテキストファイル)
    • R Graphics の記述に関係ありそうなところだけをいいかげんに抜粋してます
  • R Graphics が執筆された当事 (R-2.0, R-2.1 あたり) と比較した場合の重要な相違としては,以下のような諸点でよいのだろうか?
    • 作図に日本語文字が自由に使えるようになった
      • HersheySerif フォントファミリーはもう使う必要がない?
      • family="Japan1" といった設定で無問題に見える
      • あるいは cairo な device 指定: cairo_pdf()svg() など
    • symbol フォントが使われなくなった
      • これは渡された R Graphics LaTeX 原稿にもすでに反映されている (部分的に)
    • 半透過 (semi-transparent) デヴァイスが普及した
      • Cairo 化,など
    • example() 表示に par(ask=TRUE) を指定しなくてもよくなった
      • これはささいな点ではあるけれど,初心者には重要
    • (NEWS には書いてないけど) library(ggplot2) など library(grid) な作図環境の発展

[項目]


CHANGES IN R VERSION 2.9.0 

NEW FEATURES 

  • pdf() と postscript() に useKerning 引数が追加された.
    • pdf() and postscript() gain a 'useKerning' argument to place strings using kerning (which had previously been ignored in display but not in strwidth), based in part on an idea and code from Ei-ji Nakama. The default is TRUE.
      • Kerning involving spaces is now ignored (it was previously only used in the computation of string widths).
  • boxplot() の引数で matrix を指定できるようになった
    • boxplot() gains a simple 'matrix' method, enabling boxplot(mat) instead of boxplot(data.frame(mat)).
  • clip() の動作が変更された
    • clip() takes extra steps to avoid the next graphics call resetting the clip region.
  • 新しい散布図関数 smoothScatter()
    • A new function smoothScatter has been added to package 'graphics'. It is appropriate for very dense scatter plots and uses density estimation and color to reflect density of plotting.

CHANGES IN R VERSION 2.8.1 

NEW FEATURES 

  • legend() で title.col が指定できるようになった
    • legend() gains a 'title.col' argument: the title colour was previously set from the first element of 'text.col' (which remains the default).

CHANGES IN R VERSION 2.8.0 

NEW FEATURES 

  • bitmap() が anti-aliasing をサポートした
    • bitmap() and dev2bitmap() gain support for anti-aliasing. The default type has been changed to 'png16m', which supports anti-aliasing.
  • pch=16 (ぬりつぶし●) から枠線がなくなった
    • pch=16 now has no border (for consistency with 15, 17, 18) and

      hence is now different from pch=19.

  • pdf() で useDingbats を指定できるようになった
    • pdf() has new arguments 'useDingbats' (set this to FALSE for use with broken viewers) and 'colormodel'. It now only references the ZapfDingbats font if it is used (for small opaque circles).
  • デフォルトの PDF version が 1.4 になった
    • The default PDF version is now 1.4, since viewers that do not accept that are now rare.
  • pdf() における text() レンダリングが変わった (半透過)
    • Different viewers were rendering consecutive text() calls on a pdf() device in different ways where translucency was involved. The PDF generated has been changed to force each call to be rendered separately (which is the way xpdf or ghostscript was rendering, but Acrobat was forming a transparency group), which is consistent with other graphics devices supporting semi-transparency.
  • plot.dendrogram() で xlim, ylim を指定できるようになった (つまりズーム可)
    • plot.dendrogram() has new arguments (xlim, ylim) which allows zooming into a hiearchical clustering dendrogram.
  • 図の中の数式 (plotmath) で aleph と nabla が使えるようになった
    • Plotmath now recognizes 'aleph' and 'nabla' (the Adobe Symbol 'gradient' glyph) as symbol names.
  • rug() の引数が新しくなった
    • rug() now uses axis()'s new arguments from 2.7.2, hence no longer draws an axis line.
  • segments(), arrows(), rect() が長さ 0 の座標系 (?) に対処できるようになった
    • segments(), arrows() and rect() allow zero-length coordinates. (Wish of PR#11192)

CHANGES IN R VERSION 2.7.2 

NEW FEATURES 

  • axis() で col.ticks が指定可能になった
    • axis() has new arguments 'col.ticks' and 'lwd.ticks' to allow the colour and line width of ticks to be set separately from that of the line (e.g. to set one or the other to transparent or zero width).
  • legend() で box.col が指定可能になった
    • legend() has a new argument 'box.col' to set the colour of the enclosing box.
  • legend() が描かれているあいだだけ xpd になる xpd 引数が指定できるようになった
    • legend() gains a 'xpd' argument to make it easier to place a legend in the margins or outer margins.

CHANGES IN R VERSION 2.7.1 

NEW FEATURES 

  • axis() が xpd 指定の clipping に対応するようになった
    • axis() now respects the setting of par("xpd") when clipping.

CHANGES IN R VERSION 2.7.0 

SIGNIFICANT USER-VISIBLE CHANGES 

  • 非対話的な作図出力のデフォルトの出力が PDF になった
  • pdf() と bitmap() のデフォルトの幅が 7 inch になった
    • The default width and height for pdf() and bitmap() have been changed to 7 (inches) to match the screen devices.
  • X11() が cairo 化された (ということなのでしょう)
    • Most users of the X11() device will see a new device that has different fonts, anti-aliasing of lines and fonts and supports semi-transparent colours.
  • 作図デヴァイス間でできるだけ出力が似るように,たいへんな努力がはらわれた
    • Considerable efforts have been made to make the default output from graphics devices as similar as possible (and in particular close to that from postscript/pdf). Many devices were misinterpreting 'pointsize' in some way, for example as being in device units (pixels) rather than in points.

GRAPHICS CHANGES 

  • 環境変数 R_INTERACTIVE_DEVICE など追加
    • The default graphics devices in interactive and non-interactive sessions are now configurable via environment variables R_INTERACTIVE_DEVICE and R_DEFAULT_DEVICE respectively.
  • dev.new() が追加され,図のコピーが便利になった
    • New function dev.new() to launch a new copy of the default graphics device (and taking care if it is "pdf" or "postscript" not to trample on the file of an already running copy).
  • dev.copy2pdf() 関数の追加
    • New function dev.copy2pdf(), the analogue of dev.copy2eps().
  • X11() などで title が指定可能になった
    • The X11() and windows() graphics devices have a new argument 'title' to set the window title.
  • X11.options() が導入され,パラメーターが指定できるようになった
    • X11() now has the defaults for all of its arguments set by the new function X11.options(), inter alia replacing options "gamma", "colortype" and "X11fonts".
  • pdf.options() などが追加された
    • pdf() now takes defaults from the new function pdf.options() rather that from ps.options() (and the latter was not documented prior to 2.6.1 patched).
    • The defaults for all arguments other than 'file' in postscript() and pdf() can now be set by ps.options() or pdf.options()
    • New functions setEPS() and setPS() as wrappers to ps.options() to set appropriate defaults for figures for inclusion in other documents and for spooling to a printer respectively.
  • pch で指定できる数字の範囲がひろがった
    • The meaning of numeric 'pch' has been extended where MBCSes are supported. Now negative integer values indicate Unicode points, integer values in 32-127 represent ASCII characters, and 128-255 are valid only in single-byte locales. (Previously what happened with negative pch values was undocumented: they were replaced by the current setting of par("pch").)
  • device ごとに par("ask") を指定できるようになった
    • There is a per-device setting for whether new frames need confirmation. This is controlled by either par("ask") or grid.prompt() and affects all subsequent plots on the device using base or grid graphics.
  • X11() が cairo に対応するようになった
    • There is a new version of the X11() device based on cairo graphics which is selected by type "cairo" or "nbcairo", and is available on machines with cairo installed and preferably pango (which most machines with gtk+ >= 2.8 will have). This version supports translucent colours and normally does a better job of font selection so it has been possible to display (e.g.) English, Polish, Russian and Japanese text on a single X11() window. It is the default where available.
  • savePlot() で PNG に図を保存できるようになった
    • There is a companion function, savePlot(), to save the current plot to a PNG file.
  • Unix 上でも jpeg() や png() で cairo 指定ができるようになった
    • On Unix-alikes, devices jpeg() and png() also accept type = "cairo", and with that option do not need a running X server. The meaning of capabilities("jpeg") and capabilities("png") has changed to reflect this. On MacOS X, there is a further type = "quartz". The default type is selected by the new option "bitmapType", and is "quartz" or "cairo" where available.
  • Cairo が使えるなら svg() で SVG 出力ができるようになった
    • Where cairo 1.2 or later is supported, there is a svg() device to write SVG files, and cairo_pdf() and cairo_ps() devices to write (possibly bitmap) PDF and postscript files via cairo.
  • bmp() と tiff() デヴァイスが追加された
    • There are new bmp() and tiff() devices.
  • devSize() でデヴァイスのサイズがわかるようになった
    • New function devSize() to report the size of the current graphics device surface (in inches or device units). This gives the same information as par("din"), but independent of the graphics subsystem.
  • クリップを指定する clip() 関数が追加された
    • New base graphics function clip() to set the clipping region (in user coordinates).
  • 座標変換する grconvert[XY]() が追加された
    • New functions grconvertX() and grconvertY() to convert between coordinate systems in base graphics.
  • stripchart() が総称関数になった
    • stripchart() is now a generic function, with default and formula methods defined. Additional graphics parameters may be included in the call. Formula handling is now similar to boxplot().
  • example(ask = TRUE) が grid 作図の例でも有効になった
    • example(ask=TRUE) now applies to grid graphics (e.g. from lattice) as well as to base graphics.

DEPRECATED & DEFUNCT 

  • "symbol" が廃止予定になった
    • The 'device-independent' family "symbol" is deprecated as it was highly locale- and device-dependent (it only did something useful in single-byte locales on most devices) and font=5 (base) or fontface=5 (grid) did the job it was intended to do more reliably.
  • gamma によるガンマ値の指定が廃止予定になった
    • Setting par(gamma=) is now deprecated, and the windows() device (the only known example) no longer allows it.

CHANGES IN R VERSION 2.6.2 

CHANGES IN R VERSION 2.6.1 

NEW FEATURES 

  • plot.lm() で cex.caption が指定できるようになった
    • plot.lm() gains a new argument 'cex.caption' to allow the size of the captions to be controlled.

CHANGES IN R VERSION 2.6.0 

NEW FEATURES 

  • jpeg() などビットマップ出力の幅指定で unit 引数を指定できるようになった
    • jpeg(), png(), bmp() (Windows), dev2bitmap() and bitmap() have a new argument 'units' to specify the units of 'width' and 'height'.

CHANGES IN R VERSION 2.5.1 

CHANGES IN R VERSION 2.5.0 

CHANGES IN R VERSION 2.4.1 

NEW FEATURES 

  • rainbow() などで alpha 引数が指定可能になった
    • rainbow(), heat.colors(), terrain.colors(), topo.colors() and cm.colors() all gain an 'alpha' argument to be passed to hsv().

CHANGES IN R VERSION 2.4.0 

NEW FEATURES 

  • example() で ask 引数を指定できるようになった
    • example() gains an argument 'ask' which defaults to "TRUE when sensible", but the default can be overridden by setting option 'example.ask'.
  • par(ask = TRUE) は対話的なセッションに限定されることになった
    • par(ask=TRUE) now only applies to interactive R sessions.

CHANGES IN R VERSION 2.3.1 

CHANGES IN R VERSION 2.3.0 

USER-VISIBLE CHANGES 

  • grid のいくつかの関数で arrow 引数が使えるようになった
    • In the grid package there are new 'arrow' arguments to grid.line.to(), grid.lines(), and grid.segments() (grid.arrows() has been deprecated).
    • The new 'arrow' arguments have been added BEFORE the 'name', 'gp' and 'vp' arguments so existing code that specifies any of these arguments *by position* (not by name) will fail.

NEW FEATURES 

  • arrows() が segments() に似るように変更された
    • arrows() has been changed to be more similar to segments(): for example col=NA omits the arrow rather than as previously (undocumented) using par("col").
  • axis() の総称版 Axis() の追加
    • New function Axis(), a generic version of axis(), with Date and POSIX[cl]t methods. This is used by most of the standard plotting functions (boxplot, contour, coplot, filled.contour, pairs, plot.default, rug, stripchart) which will thus label x or y axes appropriately.
  • PDF などにフォントをうめこむ embedFonts() 関数を追加
    • New function embedFonts() for embedding fonts in PDF or PostScript graphics files.
  • pairs() で data frame などを指定できるようんなった
    • pairs() allows a wider class of inputs, including data frames with date and date-time columns.
  • pdf() の family 指定が一般的になった
    • The pdf() device now allows 'family' to be specified in the same generality as postscript().
  • plotmath で vartheta などが指定できるようになった
    • Plotmath allows 'vartheta', 'varphi' and 'varsigma' (or 'stigma') as synonyms for 'theta1', 'phi1' and 'sigma1', and the help page has a note for TeX users.
  • plot.xy() は par() の設定を反映するようになった
    • plot.xy() now takes its default arguments from the corresponding par() settings, so points(type="l") and lines(type="p") behave in the same way (and more obviously, also for type="b").

INTERNATIONALIZATION 

  • なかまさんのパッチが反映された
    • A set of patches supplied by Ei-ji Nakama has been incorporated.
    • New postscript encodings for CP1253, CP1257 and Greek (ISO 8859-7).
    • Support for East Asian CID-keyed fonts in pdf() and postscript(). Although these usually contain Latin characters no accurate AFMs are available and so CID-keyed fonts are intended only for use with CJK characters.
    • Wide-character width functions wc[s]width are provided that overcome problems found with OS-supplied ones (and those previously used by R on Windows). This means that double-width CJK characters are now supported on all platforms. It seems that the width of some characters (and not just CJK characters) depends on which CJK locale's fonts are in use and also on the OS.
    • Revised wide-character classification functions are provided for use on Windows, AIX and MacOS X to replace deficient OS-supplied ones.
    • There is support for MBCS charsets in the pictex() graphics device, and rotated (by 90 degrees) text may work better.
    • The \u (and \U except on Windows) notation for characters which is supported by the parser in all MBCS charsets is now always interpreted as a Unicode point, even on platforms which do not encode wchar_t in Unicode. These are now a syntax error in single-byte locales.
    • The default encoding for postscript() and pdf() is chosen to be suitable for the current locale, if that is a single-byte locale which is supported. This covers European (including Greek) and Cyrillic languages.
    • In UTF-8 locales, a suitable single-byte encoding is chosen for postscript() and pdf(), and text translated to it.
    • xfig() gains an 'encoding' argument.
    • There are some message translations into Spanish.

CHANGES IN R VERSION 2.2.1 

CHANGES IN R VERSION 2.2.0 

NEW FEATURES 

  • 二値データを表現する cdplot() と spineplot() が追加された
    • New functions cdplot() and spineplot() for conditional density plots and spine plots or spinograms. Spine plots are now used instead of bar plots for x-y scatterplots where y is a factor.

CHANGES IN R VERSION 2.1.1 

CHANGES IN R VERSION 2.1.0 

NEW FEATURES 

  • pdf() で paper と pagecentre が指定できるようになった
    • pdf() now responds to the 'paper' and 'pagecentre' arguments. The default value of 'paper' is "special" for backward-compatibility (this is different from the default for postscript()).
  • plotmath で下線が使えるようになった
    • Plotmath now allows underline in expressions. (PR#7286, contributed by Uwe Ligges.)
  • grid の変更あれこれ
    • Changes to package 'grid':
      • preDrawDetails(), drawDetails(), and postDrawDetails() methods are now recorded on the graphics engine display list. This means that calculations within these methods are now run when a device is resized or when output is copied from one device to another.
      • Fixed bug in grid.text() when 'rot' argument has length 0. (privately reported by Emmanuel Paradis)
      • New getNames() function to return just the names of all top-level grobs on the display list.
      • Recording on the grid display list is turned off within preDrawDetails(), drawDetails(), and postDrawDetails() methods.
      • Grid should recover better from errors or user-interrupts during drawing (i.e., not leave you in a strange viewport or with strange graphical parameter settings).
      • New function grid.refresh() to redraw the grid display list.
      • New function grid.record() to capture calculations with grid graphics output.
      • grobWidth and grobHeight ("grobwidth" and "grobheight" units) for primitives (text, rects, etc, ...) are now calculated based on a bounding box for the relevant grob. NOTE: this has changed the calculation of the size of a scalar rect (or circle or lines).
      • New arguments 'warn' and 'wrap' for function grid.grab()
      • New function grid.grabExpr() which captures the output from an expression (i.e., not from the current scene) without doing any drawing (i.e., no impact on the current scene).
      • upViewport() now (invisibly) returns the path that it goes up (suggested by Ross Ihaka).
      • The 'gamma' gpar has been deprecated (this is a device property not a property of graphical objects; suggested by Ross Ihaka).
      • New 'lex' gpar; a line width multiplier.
      • grid.text() now handles any language object as mathematical annotation (instead of just expressions).
      • plotViewport() has default value for 'margins' argument (that match the default value for par(mar)).
      • The 'extension' argument to dataViewport() can now be vector, in which case the first value is used to extend the xscale and the second value is used to extend the y scale. (suggested by Ross Ihaka).
      • All 'just' arguments (for viewports, layouts, rectangles, text) can now be numeric values (typically between 0 [left] and 1 [right]) as well as character values ("left", "right", ...).
      • For rectangles and text, there are additional 'hjust' and 'vjust' arguments which allow numeric vectors of justification in each direction (e.g., so that several pieces of text can have different justifications). (suggested by Ross Ihaka)
      • New 'edits' argument for grid.xaxis() and grid.yaxis() to allow specification of on-the-fly edits to axis children.
      • applyEdit(x, edit) returns x if target of edit (i.e., child specified by a gPath) cannot be found.
      • Fix for calculation of length of max/min/sum unit. Length is now (correctly) reported as 1 (was reported as length of first arg).
      • Viewport names can now be any string (they used to have to be a valid R symbol).
      • The 'label' argument for grid.xaxis() and grid.yaxis() can now also be a language object or string vector, in which case it specifies custom labels for the tick marks.

INTERNATIONALIZATION 

  • UTF-8 が使えるようになった,などなd
    • Unix-alike versions of R can now be used in UTF-8 and other multi-byte locales on suitably equipped OSes if configured with option --enable-mbcs (which is the default). (The changes to font handling in the X11 module are based on the Japanization patches of Ei-ji Nakama.)
    • Windows versions of R can be used in `East Asian' locales on suitable versions of Windows.
    • New function iconv() to convert character vectors between encodings, on those OSes which support this. See the new capabilities("iconv").
    • The meaning of 'encoding' for a connection has changed: it now allows any charset encoding supported by iconv on the platform, and can re-encode output as well as input.
    • New function localeToCharset() to find/guess encoding(s) from the locale name.
    • nchar() returns the true number of bytes stored (including any embedded nuls), this being 2 for missing values. It has an optional argument 'type' with possible non-default values "chars" and "width" to give the number of characters or the display width in columns.
    • Characters can be entered in hexadecimal as e.g. \x9c, and in UTF-8 and other multibyte locales as \uxxxx, \u{xxxx}, \Uxxxxxxxx or \U{xxxxxxxx}. Non-printable Unicode characters are displayed C-style as \uxxxx or \Uxxxxxxxx.
    • LC_MONETARY is set to the locale, which affects the result of Sys.localeconv(), but nothing else in R itself. (It could affect add-on packages.)
    • source() now has an 'encoding' argument which can be used to make it try out various possible encodings. This is made use of by example() which will convert (non-UTF-8) Latin-1 example files in a UTF-8 locale.
    • read/writeChar() work in units of characters, not bytes.
    • .C() now accepts an ENCODING= argument where re-encoding is supported by the OS. See `Writing R Extensions'.
    • delimMatch (tools) now reports match positions and lengths in units of characters, not bytes. The delimiters can be strings, not just single ASCII characters.
    • .Rd files can indicate via a \encoding{} argument the encoding that should be assumed for non-ASCII characters they contain.
    • Phrases in .Rd files can be marked by \enc{}{} to show a transliteration to ASCII for use in e.g. text help.
    • The use of 'pch' in points() now allows for multi-byte character sets: in such a locale a glyph can either be specified as a multi-byte single character or as a number, the Unicode point.

CHANGES IN R VERSION 2.0.1