[R] Manipulating DataSets

From: Neil Gupta <neil.gup_at_gmail.com>
Date: Fri, 06 Jun 2008 08:40:18 -0500


Hello R-users,

I have a very simple problem I wanted to solve. I have a large dataset as such:

   Lag X.Symbol Time TickType ReferenceNumber Price Size X.Symbol.1 Time.1 TickType.1 ReferenceNumber.1

1  ES 3:ESZ7.GB 08:30:00        B        74390987 151075   44
3:ESZ7.GB08:30:00          A          74390988
2  ES 3:YMZ7.EC 08:30:00        B        74390993  13686   17
3:YMZ7.EC08:30:00          A          74390994
3  YM 3:ESZ7.GB 08:30:00        B        74391135 151075   49
3:ESZ7.GB08:30:00          A          74391136
4  YM 3:YMZ7.EC 08:30:00        B        74390998  13686   17
3:YMZ7.EC08:30:00          A          74390999
5  YM 3:ESZ7.GB 08:30:00        B        74391135 151075   49
3:ESZ7.GB08:30:00          A          74391136
6  YM 3:YMZ7.EC 08:30:00        B        74391000  13686   14
3:YMZ7.EC08:30:00          A          74391001
  Price.1 Size.1  LeadTime MidPoint Spread
1  151100     22  08:30:00 *151087.5*     25
2   13688     27  08:30:00  13687.0      2
3  151100     22  08:30:00 *151087.5*     25
4   13688     27  08:30:00  13687.0      2
5  151100     22  08:30:00 151087.5     25
6   13688     27  08:30:00  13687.0      2


All I wanted to do was take the Log(MidPoint[2]) - Log(MidPoint[1]) for a symbol "3:ESZ7.GB"
So the first one would be log(151087.5) - log(151087.5). I wanted to do this throughout the data set and add that in another column. I would appreciate
any help.

Regards,

Neil Gupta

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 06 Jun 2008 - 16:40:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 06 Jun 2008 - 19:30:39 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive