From f3e15daaab759487d99cbea0025203232ed68ebe Mon Sep 17 00:00:00 2001 From: John Laing Date: Tue, 26 Jun 2018 16:31:29 -0400 Subject: [PATCH 1/2] roxygenize from #252 --- man/blpAuthenticate.Rd | 11 +++++++++-- man/blpConnect.Rd | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/man/blpAuthenticate.Rd b/man/blpAuthenticate.Rd index 009cdc0..c84cc84 100644 --- a/man/blpAuthenticate.Rd +++ b/man/blpAuthenticate.Rd @@ -19,12 +19,19 @@ call, and retrieved via the internal function \code{defaultConnection}.} } \value{ -Not sure. May just be the side effect of having the -session authenticated. +The returned object should be passed to subsequent data +calls via bdp(), bds(), etc. } \description{ This function authenticates against the the Bloomberg API } +\examples{ +\dontrun{ +blpConnect(host=blpHost, port=blpPort) +blpid <- blpAuthenticate(uuid=blpUUID, ip=blpIP_address) +bdp("IBM US Equity", "NAME", identity=blpid) +} +} \author{ Whit Armstrong and Dirk Eddelbuettel } diff --git a/man/blpConnect.Rd b/man/blpConnect.Rd index 86035f9..0e20c57 100644 --- a/man/blpConnect.Rd +++ b/man/blpConnect.Rd @@ -46,6 +46,10 @@ explicitly create such an object. con <- blpConnect() # adjust as needed } } +\seealso{ +Many SAPI and bPipe connections require authentication +via \code{blpAuthenticate} after \code{blpConnect}. +} \author{ Whit Armstrong and Dirk Eddelbuettel } From de668728032a6b9e7bb343f4607bca223c156b3f Mon Sep 17 00:00:00 2001 From: John Laing Date: Tue, 26 Jun 2018 16:44:07 -0400 Subject: [PATCH 2/2] allow character start.date in bdh per #266 --- R/bdh.R | 9 +++++++-- man/bdh.Rd | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/R/bdh.R b/R/bdh.R index b0324a4..69d2130 100644 --- a/R/bdh.R +++ b/R/bdh.R @@ -66,6 +66,10 @@ ##' bdh("SPY US Equity", c("PX_LAST", "VOLUME"), ##' start.date=Sys.Date()-31*6, options=opt) ##' +##' ## example for non-date start +##' bdh("SPY US Equity", c("PX_LAST", "VOLUME"), +##' start.date="-6CM", options=opt) +##' ##' ## example for options and overrides ##' opt <- c("periodicitySelection" = "QUARTERLY") ##' ovrd <- c("BEST_FPERIOD_OVERRIDE"="1GQ") @@ -76,8 +80,9 @@ bdh <- function(securities, fields, start.date, end.date=NULL, include.non.trading.days=FALSE, options=NULL, overrides=NULL, verbose=FALSE, identity=NULL, con=defaultConnection(), int.as.double=getOption("blpIntAsDouble", FALSE)) { - if (!class(start.date) == "Date") stop("start.date must be a Date object", call.=FALSE) - start.date <- format(start.date, format="%Y%m%d") + if (class(start.date) == "Date") { + start.date <- format(start.date, format="%Y%m%d") + } if (!is.null(end.date)) { end.date <- format(end.date, format="%Y%m%d") } diff --git a/man/bdh.Rd b/man/bdh.Rd index b6292a9..05d9021 100644 --- a/man/bdh.Rd +++ b/man/bdh.Rd @@ -68,6 +68,10 @@ Data History) queries bdh("SPY US Equity", c("PX_LAST", "VOLUME"), start.date=Sys.Date()-31*6, options=opt) + ## example for non-date start + bdh("SPY US Equity", c("PX_LAST", "VOLUME"), + start.date="-6CM", options=opt) + ## example for options and overrides opt <- c("periodicitySelection" = "QUARTERLY") ovrd <- c("BEST_FPERIOD_OVERRIDE"="1GQ")