Skip to content

Commit

Permalink
Fix getMetals() example and align with getFX() docs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshuaulrich committed Mar 31, 2021
1 parent a2aad16 commit 452745a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions man/getFX.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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.
Expand All @@ -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}
12 changes: 6 additions & 6 deletions man/getMetals.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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)).

Expand All @@ -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.
Expand All @@ -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}

0 comments on commit 452745a

Please sign in to comment.