On 21/12/2021 9:41 a.m., Sigbert Klinke wrote:
Hi,

compareVersion returns -1, 0, or 1 rather than TRUE or FALSE which could
be used in computing.


I'm not sure where you would need the 3 level value, but this would give it to you:

(packageVersion("shiny") > "0.11") - (pacageVersion("shiny") < "0.11")

Duncan Murdoch

Sigbert

Am 21.12.21 um 15:19 schrieb Martin Maechler:

Hi,
currently I have to use

compareVersion(as.character(packageVersion("shiny")), "0.11")

It would be nice if compareVersion would make the as.character
internally, rather then force the user to do it.

Thanks
Sigbert

Well, if you follow the help page examples of packageVersion()
you would use

packageVersion("Matrix") >= "1.4.0"
[1] TRUE
packageVersion("shiny") >= "0.11"
[1] TRUE




______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to