s-news
[Top] [All Lists]

[S] Re: your mail

To: s-news@wubios.wustl.edu
Subject: [S] Re: your mail
From: Greg Bond <gbond@hbs.edu>
Date: Thu, 29 Apr 1999 21:42:11 -0400
Cc: "S.D.Byers" <byers@research.att.com>
In-reply-to: <Pine.SGI.4.03.9904292021130.23899672-100000@raptor.researc h.att.com>
References: <199904300017.UAA17081@listserv.hbs.edu>
Sender: owner-s-news@wubios.wustl.edu


Thank you for the code.  I had one follow-up question.  How can I now cycle 
through the remaining columns?   I think there may be a problem because the 
first iteration destroys the symmetry of the matrix.

Greg





At 08:25 PM 4/29/99 -0400, you wrote:
>
>
>That particular example can be done with
>
>
>X[,-1] <- sweep(X[,-1],2,STATS=1-X[1,-1],FUN="*")
>
>
>I think. You will want to check, maybe the second arg should be a 1.
>
>
>       SDB
>
>On Thu, 29 Apr 1999, Greg Bond wrote:
>
>|
>|Hello,
>|
>|I?m new to Splus and I have a question about a data transformation.  I have a
>|symmetric matrix of 3000x3000 and I want to use the observations within one
>|column to change all the values of another column to zero.  For example, in 
>the
>|simple data set below, every time I find a 1 in column 1, I want all the cases
>|in the ith column to be zero (excluding the first column).  In other words,
>|column 1 is fixed, and whenever a 1 is encountered in row j, the jth column is
>|set equal to 0, except for j=1.
>|
>|1  0  0  1  0  0  0  0  1  0
>|0  1  1  1  1  1  1  1  1  1        
>|0  1  1  1  1  1  1  1  1  1
>|1  1  1  1  1  1  1  1  1  1
>|0  1  1  1  1  1  1  1  1  1
>|0  1  1  1  1  1  1  1  1  1
>|0  1  1  1  1  1  1  1  1  1
>|0  1  1  1  1  1  1  1  1  1
>|1  1  1  1  1  1  1  1  1  1
>|0  1  1  1  1  1  1  1  1  1
>|
>|The data above should convert to 
>|
>|1  0  0  0  0  0  0  0  0  0
>|0  1  1  0  1  1  1  1  0  1        
>|0  1  1  0  1  1  1  1  0  1
>|1  1  1  0  1  1  1  1  0  1
>|0  1  1  0  1  1  1  1  0  1
>|0  1  1  0  1  1  1  1  0  1
>|0  1  1  0  1  1  1  1  0  1
>|0  1  1  0  1  1  1  1  0  1
>|1  1  1  0  1  1  1  1  0  1
>|0  1  1  0  1  1  1  1  0  1
>|
>|Thanks for any help.
>|
>|Greg Bond
>|
>|-----------------------------------------------------------------------
>|This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
>|send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
>|message:  unsubscribe s-news
>|
> 
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [no subject], Greg Bond
    • Message not available
      • [S] Re: your mail, Greg Bond <=
    • [S] Re:, Adelchi Azzalini