[R] naming rows and columns in a matrix

2008-12-28 Thread Math Girl
Hello, I have a 3 x 7 matrix. I want to assign a name to each row and each column. I tried using dimnames, but for some reason I cannot retrieve the names of the rows or the names of the columns. Is there another way to name the rows and columns and refer to them? [[alternati

[R] how to generalize the arguments for lm() (r-h...@lists.r-project.org)

2008-12-27 Thread Math Girl
Hello, How could I generalize the following statement for an arbitrary number of columns instead of 7? result[[i]]<-lm( returns[,i] ~ factors[,1] + factors[,2] + factors[,3] + factors[,4] + factors[,5] + factors[,6] + factors[,7] ) Thank you, Mathgurl [[alternative HTML vers