s-news
[Top] [All Lists]

Re: Matrix question

To: <s-news@lists.biostat.wustl.edu>, "Spencer Graves" <spencer.graves@pdf.com>
Subject: Re: Matrix question
From: "Chushu Gu" <chushugu@hotmail.com>
Date: Sat, 25 Oct 2003 13:01:47 -0700
References: <Law11-OE646X0ZB9zBo0000b3ad@hotmail.com> <3F9A4DE2.4020807@pdf.com> <Law11-OE65DhsXOcOHe0000b655@hotmail.com> <3F9AA47C.7030605@pdf.com>
Thanks Spencer Graves,
My further question is that I am intertested in the sum of that vector (5,4,1,4), which is 14.
Is that possible to finish it in one step so that I don't need to calculate that vector first, then sum it up.
 
Chushu Gu
----- Original Message -----
Sent: Saturday, October 25, 2003 9:27 AM
Subject: Re: [S] Matrix question

1.  I don't understand your question. 

2.  Please "reply to all", as others might be able to answer, and still others may be interested in your further question and any further responses. 

spencer graves

Chushu Gu wrote:
Is there any easy way to sum it up?


----- Original Message ----- 
From: "Spencer Graves" <spencer.graves@pdf.com>
To: "Chushu Gu" <chushugu@hotmail.com>
Cc: <s-news@lists.biostat.wustl.edu>
Sent: Saturday, October 25, 2003 3:18 AM
Subject: Re: [S] Matrix question


  
With A2 = your matrix, I get your answer from "apply(A2, 2, 
function(x)which(!x)[1])". 

hope this helps.  spencer graves

Chushu Gu wrote:

    
Dear All,
 
I have a matrix
 
T T F T
T T T T
T T F T
T F T F
F T T F
T F F T
F T F F
 
What I need is to get the first F location in every column. The result 
I want is (5,4,1,4), How I use "which" to conquer this problem?
 
Chushu Gu
      
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news

    
<Prev in Thread] Current Thread [Next in Thread>