[R] currency conversion function?

Liviu Andronic landronimirc at gmail.com
Fri Oct 16 15:04:32 CEST 2009


On 10/15/09, Jeff Ryan <jeff.a.ryan at gmail.com> wrote:
>  > getFX("EUR/USD",from="2009-04-01")
>
Indeed, with the date correctly specified, the function no longer
generates errors. There is one issue though (similar to the one in the
code posted by Henrique):
> getFX("EUR/PEN",from="2009-10-16")
[1] "EURPEN"
> EURPEN
           EUR.PEN
2009-10-16  4.3197
> getFX("PEN/EUR",from="2009-10-16")
[1] "PENEUR"
> PENEUR  ### doesn't coincide with the value on the web page
           PEN.EUR
2009-10-16  0.2377
#Friday, October 16, 2009
#1 Euro = 4.31973 Peruvian Nuevo Sol
#1 Peruvian Nuevo Sol (PEN) = 0.23150 Euro (EUR)

While EUR/PEN is correct, PEN/EUR seems wrong. I spotted this in other
currencies, too.



>  If you are looking for additional FX data, the FRED archive (St. Louis Fed)
>  is very good as well...
>
>  http://research.stlouisfed.org/fred2/categories/94
>
>  > getSymbols("DEXUSEU", src="FRED")
>
Thank you for the pointer. Best
Liviu




More information about the R-help mailing list