require("quantmod")
This works:
#Symbol for Natural Gas in front month with Yahoo Finance
getQuote("NGH16.NYM", src="yahoo")
but this doesn't"
getSymbols("NGH16.NYM", src="yahoo", from="2015-09-01")
Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,
cannot open URL 'http://ichart.finance.yahoo.com/table.csv?s=NGF16.NYM&a=8&b=01&c=2015&d=11&e=24&f=2015&g=d&q=q&y=0&z=NGF16.NYM&x=.csv'
In addition: Warning message:
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, :
cannot open: HTTP status was '404 Not Found'
How do I get price history?
You assume that because you can get current data snapshots you can also get historical series.
That assumption is incorrect. Data is now an important product for many exchanges, and you generally need to pay for it.
There are other ways, though, and for commodities data Quandl may be your best bet. Searching for 'natural gas nymex' leads you eg to this NG_H2014 contract, and the Quandl package on CRAN is excellent because all this is now very scriptable too.
Here eg is the March 2016 expiry from your question:
Or as a zoo object ready for plotting: