Skip to content
Prev 4122 / 63424 Next

scoping problems (PR#614)

On Mon, Jul 24, 2000 at 11:51:12PM +0200, kjetilh@umsanet.edu.bo wrote:
The problem is with 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
...

  
    
Message-ID: <20000725102109.Z6896@stat1.stat.auckland.ac.nz>
In-Reply-To: <200007242151.XAA03966@pubhealth.ku.dk>; from kjetilh@umsanet.edu.bo on Mon, Jul 24, 2000 at 11:51:12PM +0200