As the title, I know we can use quantmod
package to get stock prices, but how can we retrieve commodity prices like Gold, Oil or Aggs?
Use Quandl
package, here are some examples
Gold <- Quandl("LBMA/GOLD")
WTI <- Quandl("CHRIS/CME_CL1")
Corn <- Quandl("CHRIS/CME_C1")
You can go to their website for more information.
This is the page you can get ticker information.