Re: R-beta: problem with locfit

Clive Loader (
Thu, 26 Mar 1998 10:27:17 -0500

Date: Thu, 26 Mar 1998 10:27:17 -0500
From: Clive Loader <>
Subject: Re: R-beta: problem with locfit wrote:
> I installed the locfit package under Linux (gcc 2.7.2). Installation
> was ok but
> > m <- locfit(y~x,cens=cens,family="gamma")
> /usr/local/src/R-0.61.1/bin/R.binary: can't resolve symbol 'igamma'

> Perhaps, a better possibility is to define igamma and ibeta using
> the R pgamma and pbeta function. However, I have not tried it.

placing (in the locfit/src/family.c file)

extern double pgamma(), pbeta();
#define igamma(x,p) pgamma(x,p,1.0)
#define ibeta(x,a,b) pbeta(x,a,b)

seems to solve the problem. (Big plus of R over S: pgamma() etc. can be
called directly,
instead of cribbing source code!).

A second problem is that the R (0.61.1) model.extract() function differs
from the
S version, and the cens argument won't be interpreted properly. Adding
the following
modified model.extract() to the locfit/R/lfrsup.r file should work...

model.extract <-
function (frame, component)
        component <- as.character(substitute(component))
        rval <- switch(component, response = model.response(frame),
                offset = model.offset(frame), weights =
                start = frame$"(start)", cens=frame$"(cens)",
        if (length(rval) == nrow(frame))
                names(rval) <- attr(frame, "row.names")
        else if (is.matrix(rval) && nrow(rval) == nrow(frame)) {
                t1 <- dimnames(rval)
                dimnames(rval) <- list(attr(frame, "row.names"),

r-help mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: