as.numeric with trailing spaces (PR#213)

John.Peters@tip.csiro.au John.Peters@tip.csiro.au
Mon, 21 Jun 1999 01:24:25 +0200 (MET DST)


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".

Thanks for R
----------------------------------------------------------------------------
John Peters
CSIRO National Measurement Laboratory
PO Box 218                                Phone:    +61 2 9413 7503
Lindfield NSW 2070                        Fax:      +61 2 9413 7202
Australia                                 Internet: John.Peters@tip.CSIRO.AU
----------------------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._