complex numbers in library function (PR#1737)
murdoch@stats.uwo.ca
murdoch@stats.uwo.ca
Wed, 3 Jul 2002 15:15:52 +0200 (MET DST)
This looks like bug PR#1697 in the deparser. I've written a patch
that fixes that case; I'll check out this one.
On Wed, 3 Jul 2002 14:25:59 +0200 (MET DST), you wrote in message
<200207031225.OAA08552@pubhealth.ku.dk>:
>Full_Name: Alex Deckmyn
>Version: 1.5.1
>OS: Linux Mandrake 7.0
>Submission from: (NULL) (193.190.63.62)
>
>
>A short function in a library contains the complex number -2i :
>
>phihat <- function(x)
> {
>x+ (-2i)
> }
>
>
>If i read the source file with source("phihat") this works fine. If I include it
>as
> a function in a library and read it with library(test), the function is still
>read corectly, but when I print it out it shows as
>
>> phihat
>function (x)
>{
> x + (-0+2i)
>}
The difference is that in the first case R keeps the source of the
function (in attr(phihat,'source')). In the second case it deparses
the internal representation.
Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._