From 452745a21d80df436a71498a2f9959341224fef7 Mon Sep 17 00:00:00 2001 From: Joshua Ulrich Date: Wed, 31 Mar 2021 08:45:55 -0500 Subject: [PATCH] Fix getMetals() example and align with getFX() docs The examples in getMetals() used getFX() with metals symbols, which threw an error. Also make the documentation for getMetals() and getFX() more consistent. Thanks to @nachi for the report and patch. Fixes #330. --- man/getFX.Rd | 11 ++++++----- man/getMetals.Rd | 12 ++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/man/getFX.Rd b/man/getFX.Rd index 2ceec6a6..0f401551 100644 --- a/man/getFX.Rd +++ b/man/getFX.Rd @@ -14,7 +14,6 @@ getFX(Currencies, warning = TRUE, auto.assign = TRUE, ...) } -%- maybe also 'usage' for other objects documented here. \arguments{ \item{Currencies}{ Currency pairs expressed as \sQuote{CUR/CUR} } \item{from}{ start date expressed in ISO CCYY-MM-DD format } @@ -30,8 +29,12 @@ A convenience wrapper to \code{getSymbols(x,src='oanda')}. See \code{getSymbols} and \code{getSymbls.oanda} for more detail. } \value{ -The results of the call will be the data will be assigned -automatically to the environment specified (parent by default). Additionally +Data will be assigned +automatically to the environment specified (the parent environment by default). +If \code{auto.assign = FALSE}, the data from a single metal +request will simply be returned from the function call. + +If \code{auto.assign = TRUE} is used (the default) a vector of downloaded symbol names will be returned. See \code{getSymbols} and \code{getSymbols.oanda} for more detail. @@ -47,6 +50,4 @@ getFX("USD/JPY") getFX("EUR/USD",from="2005-01-01") } } -% Add one or more standard keywords, see file 'KEYWORDS' in the -% R documentation directory. \keyword{ utilities} diff --git a/man/getMetals.Rd b/man/getMetals.Rd index b5db6b6b..b7058119 100644 --- a/man/getMetals.Rd +++ b/man/getMetals.Rd @@ -29,7 +29,7 @@ getMetals(Metals, \details{ A convenience wrapper to \code{getSymbols(x,src='oanda')}. -The most useful aspect of getMetals is the ablity to specify the Metals +The most useful aspect of getMetals is the ability to specify the Metals in terms of underlying 3 character symbol or by name (e.g. XAU (gold) , XAG (silver), XPD (palladium), or XPT (platinum)). @@ -41,11 +41,11 @@ See \code{getSymbols} and \code{getSymbls.oanda} for more detail. } \value{ Data will be assigned -automatically to the environment specified (parent by default). -If auto.assign is set to FALSE, the data from a single metal +automatically to the environment specified (the parent environment by default). +If \code{auto.assign = FALSE}, the data from a single metal request will simply be returned from the function call. -If auto.assign is used (the default) +If \code{auto.assign = TRUE} is used (the default) a vector of downloaded symbol names will be returned. See \code{getSymbols} and \code{getSymbols.oanda} for more detail. @@ -56,9 +56,9 @@ See \code{getSymbols} and \code{getSymbols.oanda} for more detail. \examples{ \dontrun{ -getFX(c("gold","XPD")) +getMetals(c("gold","XPD")) -getFX("plat",from="2005-01-01") +getMetals("plat",from="2005-01-01") } } \keyword{ utilities}