s-news
[Top] [All Lists]

weird question

To: <s-news@wubios.wustl.edu>
Subject: weird question
From: "Leeds, Mark" <mleeds@mlp.com>
Date: Fri, 20 Jun 2003 19:40:57 -0400
Thread-index: AcM3hWXG3g83pFkzRKeZw6KFpslTWg==
Thread-topic: weird question
here is a weird Splus question for anyone who is interested :
 
i am trying to avoid looping and
i have 2 vectors say
 
startindex which is (1,9)
endindex which is (5,17)
 
but then i have another vector
price which is a vector of length  say 50 with elements in it.
 
what i want to do is build the vectors
price[1:5] and price[9:17]
but without looping ?
 
in other words, i want to do something like
temp_price[seq(startindex:endindex)]
 
and then be able to reference temp in such a way that
i know what i am referencing.
seq doesn' t take vectors though.
rep does but i don't
see how i could use rep here to do what i want to do.
 
obviously, there could be more than 2 elements in startindex and endindex so
this is a specific simple case.
 
if this isn' clear, then don't worry about it. i'm not sure if i am being so clear.
 
                                                                    thanks.
 
 
 
 
<Prev in Thread] Current Thread [Next in Thread>
  • weird question, Leeds, Mark <=