Re: [R] how to return multipy matrix in a function

2011-02-07 Thread David Winsemius
On Feb 7, 2011, at 12:30 PM, zhaoxing731 wrote: Hello I have a 100*100 matrix which is from a intensive computation, e.g. mat. Is there any method/function that return the max of every row and the subscript of maximum value simultaneously #define the function returnfunction<-function(x)

[R] how to return multipy matrix in a function

2011-02-07 Thread zhaoxing731
Hello I have a 100*100 matrix which is from a intensive computation, e.g. mat. Is there any method/function that return the max of every row and the subscript of maximum value simultaneously #define the function > returnfunction<-function(x){ + value<-apply(x,1,max) + index<-apply(x,1,which.ma