search for: compareversion

Displaying 13 results from an estimated 13 matches for "compareversion".

Did you mean: compare_version
2014 Apr 24
1
The regular expressions in compareVersion()
Hi, I guess the backslash should not be used as the separator for strsplit() in compareVersion(), because the period in [.] is no longer a metacharacter (no need to "escape" it using a backslash): https://github.com/wch/r-source/blob/trunk/src/library/utils/R/packages.R#L866-L867 > compareVersion function (a, b) { .... a <- as.integer(strsplit(a, "[\\.-]")[[1L]...
2010 Jul 16
2
Recommended way of requiring packages of a certain version?
...ule version require version use version constructs which is kind of what I am looking for (especially 'use' which is evaluated at compile time), but R seems to have lost the version= argument to require(). The best I have been able to come up with are constructs of the form if ( utils::compareVersion(utils::packageDescription("data.table", fields="Version"), "1.5") < 0 ) stop("Need data.table version 1.5 or later") if ( utils::compareVersion(as.character(getRversion()), "2.11") >= 0 ) stop("Does not work yet with latest R.") B...
2024 Oct 17
1
Consider getNamespaceVersion() returning a numeric_version
...N packages, many boilerplate code from a single author and most use the version as a printable character string. A few are clearly wrong: E.g. if(getNamespaceVersion("reticulate") >= "1.36.0") will be false it that package ever reaches "1.100.0". This is what compareVersion() is for .... > On 17/10/2024 13:22, Dirk Eddelbuettel wrote: >> On 17 October 2024 at 12:38, Tim Taylor wrote: >> | Would R-Core be receptive to having getNamespaceVersion() return a >> | numeric_version object instead of a named character? >> >> Is this good enou...
2002 Jan 24
3
Best way to check/assert a certain version of or a package
When loading a package with library(APkg) or require(APkg) I would like to make sure that (1) the correct version of [R] is installed. If not an informative error message should be given. I would also like to make sure that (2) another required package which is loaded from within the APkg package (by require(OtherPkg)) is of a certain version or later. First of all, I believe that the check
2010 May 28
1
require( "foo (>= 2.1)" )
Hello, I often find myself writing code like : if( require( "foo" ) && compareVersion( packageDescription( "foo")[["Version"]], "2.1" ) < 0 ){ # code that uses version 2.1 of foo } else { stop( "could not load version >= 2.1 of foo" ) } Would it make sense to include something like this in require, library, etc ... require( &quo...
2024 Oct 17
2
Consider getNamespaceVersion() returning a numeric_version
I mean the `numeric_version` object not a numeric (double/int). Basically to protect me from myself I'd prefer not to have to remember to wrap `getNamespaceVersion()` with `as.package_version()`. I suspect a grep of CRAN may highlight others who are erroneously comparing character objects rather than a comparison between a `numeric_version` object and a character. Tim On 17/10/2024
2007 Feb 05
1
Build error with last R-devel tarball
...mem, RShowDo c, RSiteSearch, URLdecode, URLencode, alarm, apropos, argsAnywhere, assignInNamespace, as.roman, as.p erson, as.personList, available.packages, browseEnv, browseURL, bug.report, capture.output, checkCRAN , chooseCRANmirror, citation, citEntry, citHeader, citFooter, close.socket, combn, compareVersion, co ntrib.url, count.fields, data, data.entry, dataentry, de, de.ncols, de.restore, de.setup, debugger, d emo, download.file, download.packages, dump.frames, edit, emacs, example, file_test, file.edit, find, fix, fixInNamespace, flush.console, formatOL, formatUL, getAnywhere, getFromNamespace, get...
2010 Sep 16
1
a reliable way to check the latest version of R on CRAN?
...ject.org/sources.html") # the version number is in the next line of 'The latest release' rls = x[grep("latest release", x) + 1L] newver = gsub("(.*R-|\\.tar\\.gz.*)", "", rls) oldver = paste(getRversion(), collapse = ".") # new version available? compareVersion(newver, oldver) == 1L Thanks! Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA
2010 Sep 18
1
Check for updates under Windows (Was: a reliable way to check the latest version of R on CRAN?)
...ject.org/sources.html") # the version number is in the next line of 'The latest release' rls = x[grep("latest release", x) + 1L] newver = gsub("(.*R-|\\.tar\\.gz.*)", "", rls) oldver = paste(getRversion(), collapse = ".") # new version available? compareVersion(newver, oldver) == 1L Thanks! Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA
2005 Sep 06
2
help.search problem
Dear Fellow R Users, I have recently come across a weird problem with help.search: > help.search("tps") Error in rbind(...) : number of columns of matrices must match (see arg 8) > This happens no matter what I search for... Any thoughts ? Thanks, Tolga Please follow the attached hyperlink to an important disclaimer
2004 Dec 07
0
Installation of R-2.0.1 failure
...X11 update.packages pkgDepends download.file dataentry download.file X11 order text html latex example outer text html latex example package_version text html latex example missing link(s): compareVersion parse text html latex example paste text html latex example path.expand text html latex example pmatch text html latex example polyroot...
2004 Oct 04
7
R 2.0.0 is released
...shlist entry PR#6832) thanks to contributions from Arni Magnusson. For consistency, 'boxwex' is not an explicit argument anymore. o chull() has been moved to package graphics (as it uses xy.coords). o There is now a coef() method for summaries of "nls" objects. o compareVersion(), packageDescription() and read.00Index() have been moved to package 'utils'. o convolve(), fft(), mvfft() and nextn() have been moved to package stats. o coplot() now makes use of cex.lab and font.lab par() settings. o cumsum/prod/max/min() now preserve names. o data...
2004 Oct 04
7
R 2.0.0 is released
...shlist entry PR#6832) thanks to contributions from Arni Magnusson. For consistency, 'boxwex' is not an explicit argument anymore. o chull() has been moved to package graphics (as it uses xy.coords). o There is now a coef() method for summaries of "nls" objects. o compareVersion(), packageDescription() and read.00Index() have been moved to package 'utils'. o convolve(), fft(), mvfft() and nextn() have been moved to package stats. o coplot() now makes use of cex.lab and font.lab par() settings. o cumsum/prod/max/min() now preserve names. o data...