Hi R,

 

I have a matrix x with repeating row names. 

> dim(x)

[1] 862  19

 

zz<-matrix(0,4,4)

rownames(zz)=c("a","a","b","b")

data.frame(zz) (?)

 

 

I need to use x in a linear regression

lm(as.formula(paste("final_dat[,5]~",paste(colnames(x),collapse="+"))),x
)

this gives me a error

 

Error in model.frame.default(formula =
as.formula(paste("final_dat[,5]~",  : 

  'data' must be a data.frame, not a matrix or an array

 

 

> sessionInfo()

R version 2.7.1 (2008-06-23) 

i386-pc-mingw32 

 

locale:

LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

 

attached base packages:

[1] stats     graphics  grDevices utils     datasets  methods   base


 

other attached packages:

[1] xlsReadWrite_1.3.2

 

Thanks in advance

Ravi

 

 

 

This e-mail may contain confidential and/or privileged i...{{dropped:13}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to