[R] matrix rows to single numeric element

2011-08-04 Thread Wegan, Michael (DNRE)
I have a matrix of 5 columns and 64 rows, let's call it mat1.  All values are 
1 or 0.  I need to take the values of the elements by row and create a single 
numeric element that can be placed its respective slot in a 64-element list, 
named list1.  For example, mat1[11,1:5] = 0,1,1,0,1 and I must put 01101, 
with a length of 1, into the 11th element of list1.  I can create the code for 
an iterative process, but am having a great deal of difficulty in figuring out 
how to create a single element from the row values, especially when the first 
value is 0, as in my example.


Thanks in advance.

[[alternative HTML version deleted]]

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


[R] How to call R-squared values from lm's?

2010-12-02 Thread Wegan, Michael (DNRE)
I would like to call both p-values and R-squared values from lm's in a 
function.  I can get the p-values from coef(summary(name.lm))[r,c], however, I 
cannot figure out how to call the R-squared values without manually calling the 
summary and inserting them in the script - which negates the value of 
automating the process through a function.

Thanks,
Mike

[[alternative HTML version deleted]]

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