That is because there are no options on these specific tickers, as you can
see by the grayed out "options" link on the corresponding yahoo page.

For options on the S&P, you need to use "SPY", and "^DJX" for the DJIA.

On Mon, Nov 15, 2010 at 5:06 PM, Noah Silverman <noah@smartmediacorp.com>wrote:

> Hi,
>
> I think I've found a bug in the quantmod library.
>
> The function "getOptionChain" fails when fetching the chain of an index
> (S&P, DJIA, etc.)
> (Note:  It works beautifully for options on stocks.)
>
> chain <- getOptionChain("^GSPC", Exp=NULL)
> Error in strsplit(opt, "<tr.*?>")[[1]] : subscript out of bounds
>
> chain <- getOptionChain("^RUT", Exp=NULL)
> Error in from:to : NA/NaN argument
>
>
> Any ideas?
>
> -N
>
> _______________________________________________
> 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.
>

	[[alternative HTML version deleted]]

