Description Usage Arguments Details Value Note Author(s) References Examples
nrb_fx
downloads foreign exchange rates from Nepal Rastra Bank.
1 |
fx_codes |
a character vector of currency symbols expressed in ISO 4217 currency code format. |
from |
begin date expressed in ISO CCYY-MM-DD format
(e.g.,"2015-07-08"). The |
to |
end date expressed in ISO CCYY-MM-DD format
(e.g., "2015-07-09"). The |
showProgress |
default is TRUE. Displays progress on the console |
The nrb_fx
downloads buying and selling exchange rates for a
given currency symbols and the given begin and end dates from Nepal Rastra Bank.
The nrb_fx
will return an error with message if currency symbols are not
valid. For a valid currency symbol and valid begin date and end date, the end
date must be greater than or equal to the begin date, else the nrb_fx
will return an error along with message. If the begin date is in valid format,
it must not be less than "2000-01-01".
nrb_fx
will return the object of class dataframe with 4 variables:
fx_date
,
fx_codes
,
buy_sell
, and
fx_rate
Buying and Selling rates exist only for selected currency symbols. See http://www.nrb.org.np/fxmexchangerate.php for details. For Japanese Yen (JPY) and South Korean Won (KPW), exchange rates are quoted in 10 and 100 units, respectively.
Nayan Krishna Joshi
https://en.wikipedia.org/wiki/ISO_4217 for currency codes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# return the foreign exchange rate (buy and sell) for USD from '2015-06-10' to
# '2015-07-10'
nrb_fx("USD", "2015-06-10", "2015-07-10")
# return the foreign exchange rate (buy and sell) for USD and EUR from
# '2015-06-10' to '2015-07-10'
nrb_fx(c("USD", "EUR"), "2015-06-10", "2015-07-10")
# draw an interactive time series chart of foreign exchange rate for USD (sell)
# from '2015-06-10' to '2015-07-10'
require(xts)
require(dygraphs)
data_fx <- nrb_fx("USD", "2015-06-10", "2015-07-10")
data_fx <- xts(data_fx[, -1], order.by = data_fx[, 1])
graph_fx <- dygraph(data_fx[data_fx$buy_sell == "sell", "fx_rate"],
main = "Time series graph of foreign exchange rate for
USD (sell) from 2015-06-10 to 2015-07-10")
dyRangeSelector(graph_fx, height = 20, strokeColor = "darkred")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.