From p.dalgaard@biostat.ku.dk  Mon Jun 21 10:12:31 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 21 Jun 1999 11:12:31 +0200
Subject: as.numeric with trailing spaces (PR#213)
In-Reply-To: John.Peters@tip.csiro.au's message of "Mon, 21 Jun 1999 01:24:25 +0200 (MET DST)"
References: <199906202324.BAA11356@pubhealth.ku.dk>
Message-ID: <x2lndd9atc.fsf@blueberry.kubism.ku.dk>

John.Peters@tip.csiro.au writes:

> For R bugs:
> 
> "as.numeric" fails on strings with trailing spaces:
> (OK in Splus 3.4).
> 
> > as.numeric(c("2"," 3","4 "," 5 "))
> Warning: NAs introduced by coercion
> [1]  2  3 NA NA
> >
> 
> occurs in both "rw0641b" and "R-base-0.64.1-4-i386.rpm".

Could probably be argued that one deserves what one gets in that case,
but it'll be easier just to change it.... (*endp == '\0' after strtod
needs to check for blank-or-empty string instead).

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


as.numeric with trailing spaces (PR#213)
Peter Dalgaard BSA