[R] working with matrix

2007-07-04 Thread Yemi Oyeyemi
I am new in R and I want to solve this problem;
  I have a matrix X (with n-rows and p-colums) my problem is to obtain the 
products of the vectors of rows and print out only the maximum value and 
identify the row that gives the maximum value. Thanks
  Oyeyemi, G.M

 
-
Don't pick lemons.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.


Re: [R] working with matrix

2007-07-04 Thread Gabor Csardi
which.max(apply(mat, 1, prod))

Gabor

On Wed, Jul 04, 2007 at 09:18:41AM -0700, Yemi Oyeyemi wrote:
 I am new in R and I want to solve this problem;
   I have a matrix X (with n-rows and p-colums) my problem is to obtain the 
 products of the vectors of rows and print out only the maximum value and 
 identify the row that gives the maximum value. Thanks
   Oyeyemi, G.M
 
  
 -
 Don't pick lemons.
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch 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.

-- 
Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK

__
R-help@stat.math.ethz.ch 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.


Re: [R] working with matrix

2007-07-04 Thread S Ellison
Yemi,

Try

which.max(apply(X,1,prod))

(or possibly abs(apply(X,1,prod)) if you're only interested in unsigned product 
max.

S

 Yemi Oyeyemi [EMAIL PROTECTED] 04/07/2007 17:18:41 
I am new in R and I want to solve this problem;
  I have a matrix X (with n-rows and p-colums) my problem is to obtain the 
products of the vectors of rows and print out only the maximum value and 
identify the row that gives the maximum value. Thanks
  Oyeyemi, G.M

 
-
Don't pick lemons.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.

***
This email and any attachments are confidential. Any use, co...{{dropped}}

__
R-help@stat.math.ethz.ch 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] Working with matrix

2007-07-04 Thread Yemi Oyeyemi
Dear,
Thanks for your prompt assistant. The problem I posted is 
just a bit of my problem. The whole problem is that; 
  1. I simulated a multivariate data set X (n by p)
  2. Then draw sample without replacement from X (k less than n)
  3. Compute the eigen values of the variance-covariance matrix of the sample 
drawn
  4. Store the eigen values in matrix eigenvals
  5. Store the samples(that is the row identifier) drawn in rowvals
  6. Bind the two matrices using rbind.
  The problem is;
  7. Now I want the print out of the maximum values of the eigenvalues product 
and samples that give such maximum product.
  Thanks
  Oyeyemi Gafar M.


   
-
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us.
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch 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.