Skip Menu |

This queue is for tickets about the Statistics-R CPAN distribution.

Report information
The Basics
Id: 71988
Status: resolved
Priority: 0/
Queue: Statistics-R

People
Owner: Nobody in particular
Requestors: dheiman [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.22
Fixed in: (no value)



Subject: arrayref of string scalars misidentified as numbers
Statistics-R-0.22 Perl v5.10.1 Linux (CentOS) 2.6.18-194.8.1.el5 x86_64 an arrayref of the form: Show quoted text
>my $c =
['gi|57116681|ref|NC_000962.2|', 'gi|57116681|ref|NC_000962.2|', 'gi|571 16681|ref|NC_000962.2|']; when used with Show quoted text
>R->set('c', $c);
results in the error: Show quoted text
>Problem running the R command: >c <- c(gi|57116681|ref|NC_000962.2|, gi|57116681|ref|NC_000962.2|,
gi|57116681|ref|NC_000962.2|) Show quoted text
> >Got the error: > unexpected ',' in "c <- c(gi|57116681|ref|NC_000962.2|,"
When I create the initial arrayref as follows, everything works: Show quoted text
>my $c =
['"gi|57116681|ref|NC_000962.2|"', '"gi|57116681|ref|NC_000962.2|"', '"g i|57116681|ref|NC_000962.2|"']; It looks to be a bug in the string identifying regex in the module on line 425 of R.pm: if ( $$arr[$i] !~ /$RE{num}{real}/ ) { should be if ( $$arr[$i] !~ /^$RE{num}{real}$/ ) { The above change fixes the issue.
Hi, As you found out, the problem was due to Statistics::R misidentifying number-containing strings for numbers and failing to quote them. Thanks for the report and the patch. I released a new version of Statistics::R, version 0.23, that addresses the problem. Best, Florent