求出引入的R a函数的版本

时间:2021-09-06 21:11:11

Is there a way to find out what version of R certain functions were introduced in? For example regmatches is a useful function but it is fairly new and I believe it was introduced with 2.14. How could I easily figure out something like regmatches was introduced in R 2.14?

有没有一种方法可以找出在R中引入了什么版本的函数?例如,regmatches是一个有用的函数,但它是一个相当新的函数,我相信它是在2.14中引入的。我怎么能轻松地算出像re2.14中引入的regmatches之类的东西呢?

2 个解决方案

#1


21  

Even easier than Dirk's solution is to use R's news function:

比Dirk的解决方案更简单的是使用R的新闻函数:

> 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().

As of R-3.3.0, news will launch via the HTML help system if it is available. You can suppress it via the print.news_db method:

从R-3.3.0开始,如果可用,新闻将通过HTML帮助系统发布。你可以通过打印来抑制它。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.

#2


10  

You can use the SVN repository:

您可以使用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$ 

I applied svn log to the manual page as I didn't immediately see the R file the function is defined in; the command would work the same way there...

我将svn日志应用到手册页,因为我没有立即看到函数的定义;该命令在那里的工作方式也是一样的……

#1


21  

Even easier than Dirk's solution is to use R's news function:

比Dirk的解决方案更简单的是使用R的新闻函数:

> 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().

As of R-3.3.0, news will launch via the HTML help system if it is available. You can suppress it via the print.news_db method:

从R-3.3.0开始,如果可用,新闻将通过HTML帮助系统发布。你可以通过打印来抑制它。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.

#2


10  

You can use the SVN repository:

您可以使用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$ 

I applied svn log to the manual page as I didn't immediately see the R file the function is defined in; the command would work the same way there...

我将svn日志应用到手册页,因为我没有立即看到函数的定义;该命令在那里的工作方式也是一样的……