Learn R Programming

FinancialInstrument (version 1.3.1)

.get_rate: get an exchange rate series

Description

Try to find exchange rate data in an environment, inverting if necessary.

Usage

.get_rate(ccy1, ccy2, env = .GlobalEnv)

Arguments

ccy1

chr name of 1st currency

ccy2

chr name of 2nd currency

env

environment in which to look for data.

Value

xts object with as many columns as practicable.

See Also

buildRatio redenominate

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
EURUSD <- getSymbols("EURUSD=x",src='yahoo',auto.assign=FALSE)
USDEUR <- .get_rate("USD","EUR")
head(USDEUR)
head(EURUSD)
# }

Run the code above in your browser using DataLab