harald.fekjar@basalmed.uio.no
2001-Mar-08 15:20 UTC
[Rd] as.numeric - Possible error (PR#870)
Full_Name: Harald Fekjær Version: 1.22 OS: Windows Submission from: (NULL) (158.36.132.220) Dear R developers Is this done with purpose...: In R I get: ---> as.numeric(" ")[1] 0> as.integer(" ")[1] 0 --- While in the same in S-PLUS returns: ---> as.numeric(" ")[1] NA> as.integer(" ")[1] NA --- For my applications, the later (S-PLUS) definitely makes most sense, but you my have some good reasons for your choose? (Anyway it is quite dangers with these differences when porting applications). Thanks for a wonderful program! Harald Fekjær, Oslo, Norway -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
2001-Mar-09 09:08 UTC
[Rd] as.numeric - Possible error (PR#870)
>>>>> "harald" == harald fekjar <harald.fekjar@basalmed.uio.no> writes:harald> Full_Name: Harald Fekjær harald> Version: 1.22 harald> OS: Windows harald> Submission from: (NULL) (158.36.132.220) harald> Dear R developers harald> Is this done with purpose...: harald> In R I get: harald> --- >> as.numeric(" ") harald> [1] 0 >> as.integer(" ") harald> [1] 0 harald> --- harald> While in the same in S-PLUS returns: harald> --- >> as.numeric(" ") harald> [1] NA >> as.integer(" ") harald> [1] NA harald> --- harald> For my applications, the later (S-PLUS) definitely makes most harald> sense, but you my have some good reasons for your choose? harald> (Anyway it is quite dangers with these differences when porting harald> applications). Note that it's also for other ``blank like'' strings : > sapply(c("", " ", "\t", "\n", "\r"), as.numeric) \t \n \r 0 0 0 0 0 Without having the time currently to investigate your suggested change, I tend to agree. harald> Thanks for a wonderful program! you're welcome! harald> Harald Fekjær, Oslo, Norway Martin Maechler <maechler@stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._