14

有没有办法找出引入了某些功能的 R 版本?例如 regmatches 是一个有用的功能,但它是相当新的,我相信它是在 2.14 中引入的。我怎么能很容易地弄清楚 R 2.14 中引入了诸如 regmatches 之类的东西?

4

2 回答 2

22

比 Dirk 的解决方案更容易的是使用 R 的news函数:

> newsDB <- news()
> news(grepl("regmatches",Text), db=newsDB)
Changes in version 2.14.0:

NEW FEATURES

    o   New function regmatches() for extracting or replacing matched or
         non-matched substrings from match data obtained by regexpr(),
         gregexpr() and regexec().

从 R-3.3.0开始,news如果可用,将通过 HTML 帮助系统启动。您可以通过以下print.news_db方法抑制它:

> print(news(grepl("news",Text), db=newsDB), doBrowse=FALSE)
Changes in version 3.3.0:

NEW FEATURES

    o   news() now displays R and package news files within the HTML help
         system if it is available.  If no news file is found, a visible
         NULL is returned to the console.
于 2012-04-11T18:07:46.987 回答
10

您可以使用 SVN 存储库:

edd@max:~/svn/r-devel/src/library/base/man$ svn log regmatches.Rd 
------------------------------------------------------------------------
r57006 | hornik | 2011-09-14 14:04:21 -0500 (Wed, 14 Sep 2011) | 1 line

Improve example.
------------------------------------------------------------------------
r56997 | hornik | 2011-09-12 15:16:03 -0500 (Mon, 12 Sep 2011) | 1 line

Document regmatches replacement function.
------------------------------------------------------------------------
r56893 | hornik | 2011-09-02 05:31:01 -0500 (Fri, 02 Sep 2011) | 1 line

Add first version of regmatches replacement function.
------------------------------------------------------------------------
r56818 | hornik | 2011-08-29 02:49:17 -0500 (Mon, 29 Aug 2011) | 1 line

Spelling.
------------------------------------------------------------------------
r56752 | hornik | 2011-08-18 01:40:07 -0500 (Thu, 18 Aug 2011) | 1 line

Add regmatches().
------------------------------------------------------------------------
edd@max:~/svn/r-devel/src/library/base/man$ 

我申请svn log了手册​​页,因为我没有立即看到定义函数的 R 文件;该命令将在那里以相同的方式工作......

于 2012-04-11T18:04:42.067 回答