This is implemented in quantmod as well:

> library(quantmod)
> getOptionChain("IBM", "2010-06")
$calls
                   Strike  Last   Chg   Bid   Ask Vol    OI
IBM100619C00085000     85 41.95  0.00 41.65 42.10  10    10
IBM100619C00090000     90 36.95  0.00 36.65 37.05  10    23
IBM100619C00095000     95 32.00  0.00 31.65 32.05  10    21
IBM100619C00100000    100 27.05  0.00 26.70 27.05  10   111
IBM100619C00105000    105 22.05  0.00 21.75 22.10  10    27
IBM100619C00110000    110 17.10  0.00 16.70 17.10  10   733
IBM100619C00115000    115 12.10  0.00 11.85 12.25  19   504
IBM100619C00120000    120  6.75 -1.69  7.20  7.35  10  2067
IBM100619C00125000    125  3.35 -0.81  3.10  3.20 176  4689
IBM100619C00130000    130  0.80 -0.38  0.75  0.81 190 14452
IBM100619C00135000    135  0.11 -0.07  0.10  0.13  21 16250
IBM100619C00140000    140  0.03 -0.02  0.02  0.07  19  4629
IBM100619C00145000    145  0.02  0.00  0.01  0.02  40  2758
IBM100619C00150000    150  0.01  0.00  0.01  0.03  13   898

$puts
                   Strike  Last  Chg   Bid   Ask Vol   OI
IBM100619P00085000     85  0.04 0.00    NA  0.05   0  707
IBM100619P00090000     90  0.06 0.00  0.01  0.05 119 1477
IBM100619P00095000     95  0.07 0.00  0.03  0.05  52 1358
IBM100619P00100000    100  0.05 0.00  0.05  0.08 304 1537
IBM100619P00105000    105  0.15 0.00  0.09  0.14  62 1164
IBM100619P00110000    110  0.17 0.02  0.16  0.21  31 4158
IBM100619P00115000    115  0.30 0.09  0.28  0.31  45 6491
IBM100619P00120000    120  0.59 0.19  0.56  0.59  65 9680
IBM100619P00125000    125  1.48 0.37  1.48  1.53 333 8368
IBM100619P00130000    130  4.00 1.00  4.00  4.15  55 5896
IBM100619P00135000    135  8.40 1.40  8.35  8.60  10 1088
IBM100619P00140000    140 12.25 0.00 13.15 13.50  30   85
IBM100619P00145000    145 18.85 0.00 17.50 19.30  34   56

$symbol
[1] "IBM"

HTH
Jeff

On Fri, Jun 4, 2010 at 8:35 AM, Pete B <Peter.Brecknock@bp.com> wrote:

>
> Looks like you need to make a few changes to Martin's code
>
> I altered the following in the yahoo.getOption function
>
> Quote.date <- gsub("On |:","",info.raw[sm.pos[1]+1])
> Strike.date <- gsub("^ *|</td","",raw[expire[1]+1])
>
> to ....
>
> Quote.date <- gsub("</span","",info.raw[sm.pos[1]+2])
> x= sub('Expire at close ([^ ]+)','\\1',raw[expire[1]])
> Strike.date <- gsub("^ *|</td","",x)
>
> HTH
>
> Pete
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Getting-quotes-for-stock-options-tp2236059p2243241.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>



-- 
Jeffrey Ryan
jeffrey.ryan@insightalgo.com

ia: insight algorithmics
www.insightalgo.com

	[[alternative HTML version deleted]]

