Hello R-Users,

I am new to R and trying my best however I need help with this simple task.
I have a dataset, YM1207.
 X.Symbol                     Date Time Exchange         TickType
ReferenceNumber Price Size
12491  3:YMZ7.EC 12/03/2007 08:32:50       EC        B
85985770                13379    7
12492  3:YMZ7.EC 12/03/2007 08:32:50       EC        A
85985771                13380    4
12493  3:YMZ7.EC 12/03/2007 08:32:50       EC        T
85985845                13379    1
12494  3:YMZ7.EC 12/03/2007 08:32:50       EC        B
85985846                13379    7
12495  3:YMZ7.EC 12/03/2007 08:32:50       EC        A
85985847                13380    4
12496  3:YMZ7.EC 12/03/2007 08:32:50       EC        B
85986222                13379    6
12497  3:YMZ7.EC 12/03/2007 08:32:50       EC        A
85986223                13380    4

I want to insert a column called NPrice which takes a pair of B,A and
calculates its average Price. And than input that number in the B row and A
row in the new column NPrice. Each B, A is seperated by +1 on the Reference
Number. I want to skip T entries. T's do not come inbetween corresponding Bs
and As. The other columns are not of interest. I would really appreciate it
if I can get some help on this or refer me to a source that may.

Thankyou

Neil Gupta

	[[alternative HTML version deleted]]

