From @eb@meyer @end|ng |rom |@u@de  Thu Jul  6 09:52:59 2023
From: @eb@meyer @end|ng |rom |@u@de (Sebastian Meyer)
Date: Thu, 6 Jul 2023 09:52:59 +0200
Subject: [Rd] numeric_version doesn't like numeric versions anymore?
In-Reply-To: <674F4E4B-9A97-4185-A09B-A5E38CA6D2AC@gmail.com>
References: <674F4E4B-9A97-4185-A09B-A5E38CA6D2AC@gmail.com>
Message-ID: <0ac19a97-ff57-6325-1744-41707d3b71ba@fau.de>

Please see <https://bugs.r-project.org/show_bug.cgi?id=18548> for the 
background. The documentation has always said that the input needs to be 
a character vector. Implicit conversion of numeric input to character is 
affected by R options (OutDec and scipen), but it is also error-prone in 
this context:

R> package_version("1.3") > 1.20
[1] TRUE

This now warns for a good reason in my opinion.

Best regards,

	Sebastian Meyer


Am 06.07.23 um 08:37 schrieb Dipterix Wang:
> Dear R devs,
> 
> I installed the recent devel R to test a package error when I intercept this warning when loading packages:
> 
> ```
> Warning in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) :
>    invalid non-character version specification 'x' (type: double)
> ```
> 
> After a long debugging, I realize that `numeric_version` in base does not support numerical input x by default now.
> 
> A reproducible example:
> 
> R 4.4
> 
> ```
>> numeric_version(1.5)
> Warning in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) :
>    invalid non-character version specification 'x' (type: double)
> [1] ?1.5?
> ```
> 
> 
> R 4.3.1
> 
> ```
>> numeric_version(1.5)
> [1] ?1.5?
> ```
> 
> According to help document, `strict=TRUE` should result in errors, then the 4.3 behavior was actually incorrect. According to pkgload maintainer, Kurt has sent him an email to fix this, suggesting this on-going change is intentional.
>   
> May I ask is there any benefit of changing the behavior?
> 
> Thanks,
> - D
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] numeric_version doesn't like numeric versions anymore?
Sebastian Meyer