R-beta: bug report

Peter Dalgaard BSA p.dalgaard at kubism.ku.dk
Mon Aug 18 11:13:06 CEST 1997


Kung-Sik Chan <kchan at stat.uiowa.edu> 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?

Hmm:

> options()$echo
NULL

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
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help 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-help-request at stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the R-help mailing list