s-news
[Top] [All Lists]

[S] vector subscripting question

To: s-news@wubios.wustl.edu
Subject: [S] vector subscripting question
From: Fei Chen <fchen@stern.nyu.edu>
Date: Thu, 25 Jun 1998 11:41:39 -0400 (EDT)
Sender: owner-s-news@wubios.wustl.edu
hi all,

i thought i had understood this, but maybe not. let's say i have two
vetors a and b of length 120000, should these two expressions be the same? 

1.      a[b>0]

2.      a[b[b>0]]

in my case they turned out to be entirely different

length(a[b>0]) gives 44000
but
length(a[b[b>0]]) gives 15000

is this the correct behavior?  i did a test with smaller vector of 100
length, and they seem to be the same.

thanks for any pointers.

fei

-----------------------------------------------------------------------
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>