From kjetilh@umsanet.edu.bo  Tue Jul 25 22:46:08 2000
From: kjetilh@umsanet.edu.bo (halvorsen)
Date: Tue, 25 Jul 2000 17:46:08 -0400
Subject: [Rd] scoping problems (PR#614)
References: <200007242151.XAA03966@pubhealth.ku.dk> <20000725102109.Z6896@stat1.stat.auckland.ac.nz>
Message-ID: <397E0AA0.BF1E20D@umsanet.edu.bo>



Robert Gentleman wrote:

>

I tested the proposed change with thre original problem, and now it works fine.
Kjetil Halvorsen

>
>   The problem is with quasi:
> > quasi
> function (link = "identity", variance = "constant")
> {
>     linktemp <- substitute(link)
>     if (is.expression(linktemp))
>         linktemp <- eval(linktemp)
>     if (!is.character(linktemp)) {
>         linktemp <- deparse(linktemp)
>         if (linktemp == "link")
>             linktemp <- eval(link)
>     }
>    ...
>
>   Note that neither of the eval's is what is wanted. At this point
>   you just want to force the promise, ie evaluate the argument in
>   the calling environment.
>   The following piece of code seems to do that:
>
>  > quasi
> function (link = "identity", variance = "constant")
> {
>     linktemp <- substitute(link)
>     if ( is.expression(linktemp) || is.call(linktemp) )
>         linktemp <- link
>     else if (!is.character(linktemp))
>         linktemp <- deparse(linktemp)
>     if( is.character(linktemp) )
>         stats <- make.link(linktemp)
>     else
>         stats <- linktemp
> ...
> >
> >
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > 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
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
> --
> +-------------------------------------------------------------------------+
> | Robert Gentleman              phone : (64-9) 3737-599 ext 3946          |
> | Senior Lecturer               fax :   (64-9) 3737-018                   |
> | Department of Statistics      office : Room 206 Maths/Physics           |
> | University of Auckland        email : rgentlem@stat.auckland.ac.nz      |
> +-------------------------------------------------------------------------+
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

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


[Rd] scoping problems (PR#614)
halvorsen