s-news
[Top] [All Lists]

a vector question

To: <s-news@lists.biostat.wustl.edu>
Subject: a vector question
From: "Leeds, Mark" <mleeds@mlp.com>
Date: Mon, 18 Apr 2005 17:43:57 -0400
Thread-index: AcVEX7lSoyYi2F89Q9K0wEwwmFq82w==
Thread-topic: a vector question

Suppose I have a true false vector such as

 

1806       1806    1923      1806      6429

 

T              F           T         T             F

 

What I want is a new vector of the

same length but with the sums of  the

TRUEs as the new elements.

 

 

So, the vector output from above would be

 

1806        1806       1923        1806    6429

 

  2             2             1             2          0

 

 

I have a feeling someone out there has done this

before ? If so, it’s much appreciated. If not,

but you know how to do this, that’s

much appreciated also.

 

 

                                                Mark

 

  

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