[Rd] model.frame deficiency

Terry Therneau therneau at mayo.edu
Fri Oct 8 01:17:37 CEST 2010


The model.frame function has trouble with a certain type of really long
formula.  Here is a test:

tname <- paste('var', 1:50, sep='')
tmat <- matrix(rnorm(500), ncol=50, dimnames=list(NULL, tname))
tdata <- data.frame(tmat)

temp1 <- paste( paste(tname, tname, sep='='), collapse=', ')
temp2 <- paste("~1 + cbind(", temp1, ")")
model.frame(as.formula(temp2), tdata)

 This came out of a user report to me.  Coxph with a very long formula
(which does work) followed by a call to survexp leads to a call like the
above but using my "ratetable" function instead of "cbind".   

My machine's details:
R version 2.10.0 (2009-10-26) 
x86_64-unknown-linux-gnu 

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] grDevices datasets  splines   graphics  utils     stats
methods  
[8] base     


Editorial comment: I said "deficiency" not "bug" above, as I'm not so
sure how good a model with 75 variables might be in the first place.
(Though in this case the user is pretty savvy.)  

Terry Therneau



More information about the R-devel mailing list