[R] Help Getting the Price of Gold

Robert Sherry rsherry8 at comcast.net
Thu Oct 23 14:56:59 CEST 2014


I am trying to get the current price of gold for my application. I am 
using the library quantmod. The
R commands I use are:
      getMetals(c('XAU'), from=Sys.Date(), autoassign = FALSE )
      XAUUSD$XAU.USD[1,1]

I would expect the value in  XAUUSD$XAU.USD[1,1] to be a scalar but it 
comes back with a date and a number. All I want is the current value, 
not today's date. How do I just get the value?

Thanks
Bob

	[[alternative HTML version deleted]]



More information about the R-help mailing list