R-beta: port of bicreg package to R?

Malcolm Gillies gillies at cmcind.far.ruu.nl
Tue Sep 22 19:33:25 CEST 1998


R version: 0.62.1  (June 15, 1998)

I just very naively attempted to grab the 'bicreg' package for
Bayesian model selection from the StatLib library, and get it running
under R.

I've hit a brick wall very quickly, and as an R novice I'm not sure
where to go next.

Here's what happened:

> bicreg(as.matrix(hiv[,c(-17,-18)]),as.matrix(hiv[,18]))
Error: invalid formula

> traceback()
[1] "stop(\"invalid formula\")"                                                                                     
[2] "switch(mode(x), NULL = structure(NULL, class = \"formula\"), character = formula(eval(parse(text = x)[[1]])), "
[3] "\t    call = eval(x), stop(\"invalid formula\"))"                                                              
[4] "formula.default(cdf)"                                                                                          
[5] "model.matrix(formula(cdf), data = cdf)"                                                                        
[6] "bicreg(as.matrix(hiv[, c(-17, -18)]), as.matrix(hiv[, 18]))"                                                   
The relevant lines of code in 'bicreg' would appear to be

[...]
  cdf <-cbind.data.frame(y=y,x)
  mm <- model.matrix(formula(cdf),data=cdf)[,-1,drop=F]
[...]

It appears to me that applying formula() to the matrix is a no-no. Is
this an incompatibility between Splus and R?

Has anyone already succeeded in porting this package to R?

Or am I just doing something silly?

thanks in advance,

Malcolm
--
Malcolm Gillies <M.B.Gillies at pharm.uu.nl>
PhD student, computational medicinal chemistry
Dept Medicinal Chemistry, Faculty of Pharmacy,
Utrecht University, The Netherlands
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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