[R] lm variable name limit?

Strumila, John John.Strumila at team.telstra.com
Thu Jan 11 04:45:32 CET 2001


gday R gurus,

has anyone seen this lm problem?

When I add 2 bytes to the variable name (via names), lm returns an error.
It's as if there's a limit to the size of the variable names.

Any suggestions?

thanks,
John Strumila

>  names(y)[12:14]
[1] "Log.SQLServer.Locks.RID.Lock.Wait" "Log.SQLServer.Lock"               
[3] "xxaa"                             
>  names(y)[12]<-"Log.SQLServer.Locks.RID.Lock.Wa"
>
my.formula<-as.formula(paste(paste("y$",names(y)[12:14],collapse="+",sep="")
,' ~ ',paste('x$"',names(x),'"',sep="",collapse="+"),"-1"))
> lm(my.formula)

Call:
lm(formula = my.formula)

Coefficients:
 x$\"1\"   x$\"2\"   x$\"3\"   x$\"4\"   x$\"6\"   x$\"7\"   x$\"8\"
x$\"9\"  
       0        NA        NA        NA         0         0        NA
NA  
x$\"10\"  x$\"11\"  x$\"12\"  x$\"13\"  x$\"14\"  x$\"15\"  x$\"16\"
x$\"17\"  
       0        NA        NA        NA         0        NA         0
NA  
x$\"18\"  x$\"19\"  x$\"20\"  x$\"21\"  x$\"22\"  x$\"23\"  x$\"24\"
x$\"25\"  
       0        NA        NA        NA         0        NA         0
NA  
x$\"26\"  x$\"27\"  x$\"28\"  x$\"29\"  x$\"30\"  x$\"32\"  x$\"33\"
x$\"34\"  
      NA         0        NA        NA         0        NA        NA
NA  
x$\"35\"  x$\"36\"  x$\"37\"  x$\"38\"  x$\"39\"  x$\"40\"  x$\"41\"
x$\"42\"  
      NA        NA         0        NA         0        NA        NA
NA  
x$\"44\"  x$\"45\"  x$\"46\"  x$\"47\"  x$\"49\"  x$\"50\"  x$\"52\"
x$\"53\"  
      NA        NA        NA        NA         0        NA         0
NA  
x$\"54\"  x$\"55\"  x$\"56\"  x$\"57\"  x$\"58\"  
       0        NA         0        NA        NA  

>  names(y)[12]<-"Log.SQLServer.Locks.RID.Lock.Wait"   #<== add 2 chars to
variable name
>
my.formula<-as.formula(paste(paste("y$",names(y)[12:14],collapse="+",sep="")
,' ~ ',paste('x$"',names(x),'"',sep="",collapse="+"),"-1"))
> lm(my.formula)
Error in y$Log.SQLServer.Locks.RID.Lock.Wait + y$Log.SQLServer.Lock +  : 
        non-numeric argument to binary operator
> version
         _                
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    1.0              
year     2000             
month    June             
day      15               
language R        


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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