[R] Finding the nearest data in intraday data from two zoo objects
Gabor Grothendieck
ggrothendieck at gmail.com
Wed Nov 24 19:49:56 CET 2010
On Wed, Nov 24, 2010 at 11:04 AM, Santosh Srinivas
<santosh.srinivas at gmail.com> wrote:
> Hello Group,
>
> I have the following options and future data in zoo objects
>
>> head(optData.z)
> ExpDt OptTyp Strike TrdPrice TotTrdQty
> 2009-01-01 09:55:03 20090129 1 2900 180.0000 50
> 2009-01-01 09:55:31 20090129 1 2900 188.0000 50
> 2009-01-01 09:55:37 20090129 1 2900 185.0000 500
> 2009-01-01 09:55:39 20090129 1 2900 185.0000 500
> 2009-01-01 09:55:47 20090129 1 2900 185.1125 600
> 2009-01-01 09:55:48 20090129 1 2900 185.2500 50
>
>> head(futData.z)
> ExpDt OptTyp Strike TrdPrice TotTrdQty
> 2009-01-01 09:55:09 20090129 2 0 2979.000 900
> 2009-01-01 09:55:11 20090129 2 0 2976.633 600
> 2009-01-01 09:55:12 20090129 2 0 2977.211 900
> 2009-01-01 09:55:14 20090129 2 0 2977.750 800
> 2009-01-01 09:55:15 20090129 2 0 2977.019 4300
> 2009-01-01 09:55:16 20090129 2 0 2977.050 800
>
> I want to get the closest available futures price for every option ... Is
> there any function like the excel equivalent of approximate VLOOKUP of excel
> using date time?
>
See this:
https://stat.ethz.ch/pipermail/r-sig-finance/2010q2/006077.html
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com
More information about the R-help
mailing list