Skip to content
Prev 15523 / 63424 Next

sub('^', .....) bugs (PR#7742)

On Wed, 23 Mar 2005 maechler@stat.math.ethz.ch wrote:

            
I believe the bug is in the PERL=FALSE case.  This coercion is 
undocumented, and e.g.
Error in grep.perl(pattern, x, ignore.case, value, useBytes) :
         invalid argument
Error in grep(pattern, x, ignore.case, extended, value, fixed, useBytes) :
         invalid argument

do not accept non-character arguments.  The only one that does AFAICS is 
[g]sub(perl=FALSE), and the other functions like tolower, substr, 
strsplit, chartr, agrep do not.

The consistent thing to do seems to be to remove the anomalous coercion.
Otherwise we need to at least change grep and regexpr.