Re: R-beta: bug report

Peter Dalgaard BSA (
18 Aug 1997 11:13:06 +0200

To: Kung-Sik Chan <>
Subject: Re: R-beta: bug report
From: Peter Dalgaard BSA <>
Date: 18 Aug 1997 11:13:06 +0200
In-Reply-To: Kung-Sik Chan's message of Sun, 17 Aug 1997 19:51:20 -0700

Kung-Sik Chan <> writes:

> > predict(lm3,newdata=forbes.pred)
> Error in if (object$intercept) X <- cbind(rep(1, NROW(X)), X) : missing value wh
> ere logical needed   
> For this problem, I have fixed the predict function in src/library/base/funs as follows:
> And the predict function now seems to work ok.
> predict <- function(fit,...) UseMethod("predict")
> predict.default <- function (object, ...) {
>                  namelist <- list(...)

Yup. The current predict() has little relevance to what it should do.
It seens to come from an ancient version where almost everything
involving fit objects was different. A proper fix is somewhat more
tricky and should probably work like the one in Splus. Actually I'd
want it to do better because the factor-matching is such a pain
(prediction data may have different levels represented). I've been
working on it, but I got distracted by other matters. Will try to get
back to it soon.

> Another problem I have is that when I use the sink function to divert output
> to an external file, I used the command options(echo=T) so that the commands
> will be echoed in the external file. However, the echo command doesn't seem
> to work. Any suggestions?


> options()$echo

So it isn't implemented (yet?). One option is to do 

'R < infile > outfile'

Another is to go and implement the echo option.... ;)

Or pick up the modified S-mode and run things from emacs. (It's all
in the FAQ)

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (             FAX: (+45) 35327907
r-help mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: