Re: [R] Loop too slow for Bid calc - BUT cannot figure out how to do with matrix

2010-10-06 Thread rivercode
Duncan and Martin, Thank you for your replies. I went with Martin's suggestion as it did not require loops and is probably the fastest...though it did take me 3 hours to figure out exactly how it was working !!! Here is what I am now using: bids = cbind(bids, timeCalc) orderBids = bids[order(

Re: [R] Loop too slow for Bid calc - BUT cannot figure out how to do with matrix

2010-10-04 Thread Martin Morgan
On 10/04/2010 02:29 PM, rivercode wrote: > > Hi, > > I am trying to create Bid/Ask for each second from a high volume stock and > the only way I have been able to solve this is using loops to create the > target matrix from the source tick data matrix. Looping is too slow and > not practical to

Re: [R] Loop too slow for Bid calc - BUT cannot figure out how to do with matrix

2010-10-04 Thread Duncan Murdoch
On 04/10/2010 5:29 PM, rivercode wrote: Hi, I am trying to create Bid/Ask for each second from a high volume stock and the only way I have been able to solve this is using loops to create the target matrix from the source tick data matrix. Looping is too slow and not practical to use on multip

[R] Loop too slow for Bid calc - BUT cannot figure out how to do with matrix

2010-10-04 Thread rivercode
Hi, I am trying to create Bid/Ask for each second from a high volume stock and the only way I have been able to solve this is using loops to create the target matrix from the source tick data matrix. Looping is too slow and not practical to use on multiple stocks. For example: Bids Matrix (a r