1- # # ----store, opts.label='purlme'-----------------------------------------------
1+ # # ----store, opts.label='purlme'----------------------------------------------------------------------------------------------------
22# # Purl this first
33# # Store br.* objects in bloomr env in base namespace
44assign(' bloomr.usr' , new.env(parent = asNamespace(" stats" )))
@@ -18,7 +18,7 @@ store=function(sym){
1818}
1919
2020
21- # # ----br.bdh, opts.label='purlme'----------------------------------------------
21+ # # ----br.bdh, opts.label='purlme'---------------------------------------------------------------------------------------------------
2222br.bdh = function (
2323 con , securities , fields = " PX_LAST" , start.date , end.date = NULL ,
2424 option.names = NULL , option.values = NULL ,
@@ -32,7 +32,7 @@ br.bdh=function(
3232}
3333store(br.bdh )
3434
35- # # ----br.bulk.csv, opts.label='purlme'-----------------------------------------
35+ # # ----br.bulk.csv, opts.label='purlme'----------------------------------------------------------------------------------------------
3636br.bulk.csv = function (con , file , start = Sys.Date()- 5 , field = " PX_LAST" , cols = NULL ,
3737 addtype = FALSE , showtype = FALSE , use.xts = TRUE , comma = TRUE ,
3838 price = TRUE , nrow = 5 , same.dates = FALSE , no.na = FALSE , empty.sec = 0
@@ -77,7 +77,7 @@ br.bulk.csv=function(con, file, start=Sys.Date()-5, field="PX_LAST", cols=NULL,
7777}
7878store(br.bulk.csv )
7979
80- # # ----br.bulk.desc, opts.label='purlme'----------------------------------------
80+ # # ----br.bulk.desc, opts.label='purlme'---------------------------------------------------------------------------------------------
8181br.bulk.desc = function (con , tiks ) {
8282
8383 LL = lapply(tiks , function (tik ){
@@ -89,7 +89,7 @@ br.bulk.desc=function(con, tiks) {
8989}
9090store(br.bulk.desc )
9191
92- # # ----br.bulk.idx, opts.label='purlme'-----------------------------------------
92+ # # ----br.bulk.idx, opts.label='purlme'----------------------------------------------------------------------------------------------
9393br.bulk.idx = function (con , index , start = Sys.Date()- 5 , field = " PX_LAST" , showtype = FALSE ,
9494 include.idx = TRUE , use.xts = TRUE ,
9595 nsec = 10 , price = TRUE , nrow = 5 ,
@@ -139,7 +139,7 @@ br.bulk.idx=function(con, index, start=Sys.Date()-5, field="PX_LAST", showtype=F
139139}
140140store(br.bulk.idx )
141141
142- # # ----br.bulk.tiks, opts.label='purlme'----------------------------------------
142+ # # ----br.bulk.tiks, opts.label='purlme'---------------------------------------------------------------------------------------------
143143br.bulk.tiks = function (
144144 con ,
145145 tiks ,
@@ -223,7 +223,7 @@ br.bulk.tiks=function(
223223}
224224store(br.bulk.tiks )
225225
226- # # ----br.desc, opts.label='purlme'---------------------------------------------
226+ # # ----br.desc, opts.label='purlme'--------------------------------------------------------------------------------------------------
227227br.desc = function (con , tik )
228228{
229229
@@ -252,7 +252,7 @@ br.desc=function(con, tik)
252252}
253253store(br.desc )
254254
255- # # ----rmd-internal, opts.label='purlme'----------------------------------------
255+ # # ----rmd-internal, opts.label='purlme'---------------------------------------------------------------------------------------------
256256.br.addpaths <- function (pandonly = FALSE , quiet = TRUE ){
257257# ## Add to Windows System Path the executable directories of LaTeX, Pandoc, and Perl with this search priority, and
258258# ## return invisibly the original path. If "pandonly" is true, add only Pandoc. If "quiet" is false, print the new path.
@@ -262,18 +262,18 @@ store(br.desc)
262262 stop(" Sorry, Bloomberg Terminal only exists for Windows and so BloomR functions." )
263263
264264 # # Find executables
265- panexe = dbr.brmain (" pandoc/bin/pandoc.exe" )
265+ panexe = .br.home (" pandoc/bin/pandoc.exe" )
266266 if (! file.exists(panexe ))
267267 stop(paste(" Unable to find:" , panexe , ' \n Your BloomR edition might not support it.' ))
268268 pandir = normalizePath(dirname(panexe ))
269269
270- latbin = dbr.brmain (" latex/texmfs/install/miktex/bin/x64/latex.exe" )
270+ latbin = .br.home (" latex/texmfs/install/miktex/bin/x64/latex.exe" )
271271 if (! file.exists(latbin ) && ! pandonly ){
272272 stop(paste(" Unable to find:" , latbin , ' \n Your BloomR edition might not support it.' ))
273273 }
274274 latdir = normalizePath(dirname(latbin ))
275275
276- perlexe <- dbr.brmain (" perl/bin/perl.exe" )
276+ perlexe <- .br.home (" perl/bin/perl.exe" )
277277 if (! file.exists(perlexe ) && ! pandonly ){
278278 stop(paste(" Unable to find:" , perlexe , ' \n Your BloomR edition might not support it.' ))
279279 }
@@ -299,7 +299,7 @@ store(br.desc)
299299
300300
301301
302- # # ----br.md2pdf, opts.label='purlme'-------------------------------------------
302+ # # ----br.md2pdf, opts.label='purlme'------------------------------------------------------------------------------------------------
303303br.md2pdf = function (md.file , pdf.file , quiet = TRUE ){
304304# ## Make a markdown file into a PDF
305305# ## You need the proper BloomR version
@@ -324,7 +324,7 @@ br.md2pdf=function(md.file, pdf.file, quiet=TRUE){
324324}
325325store(br.md2pdf )
326326
327- # # ----br.rmd2html, opts.label='purlme'-----------------------------------------
327+ # # ----br.rmd2html, opts.label='purlme'----------------------------------------------------------------------------------------------
328328br.rmd2html = function (rmd.file , html.file , quiet = TRUE ){
329329# ## Make an R Markdown file into a HTML self-contained file
330330# ## You need the proper BloomR edition
@@ -355,7 +355,7 @@ br.rmd2html=function(rmd.file, html.file, quiet=TRUE){
355355}
356356store(br.rmd2html )
357357
358- # # ----br.rmd2slides, opts.label='purlme'---------------------------------------
358+ # # ----br.rmd2slides, opts.label='purlme'--------------------------------------------------------------------------------------------
359359br.rmd2slides <- function (rmd.file , html.file , quiet = TRUE ){
360360# ## Make an R Markdown file into a Google Slides self-contained HTML file
361361# ## You need proper BloomR edition
@@ -388,7 +388,7 @@ br.rmd2slides <- function(rmd.file, html.file, quiet=TRUE){
388388store(br.rmd2slides )
389389
390390
391- # # ----br.rmd2pdf, opts.label='purlme'------------------------------------------
391+ # # ----br.rmd2pdf, opts.label='purlme'-----------------------------------------------------------------------------------------------
392392br.rmd2pdf = function (rmd.file , pdf.file , quiet = TRUE ){
393393# ## Make an R Markdown file into a PDF
394394# ## You need BloomR LaTeX addons or the proper BloomR version
@@ -417,7 +417,7 @@ br.rmd2pdf=function(rmd.file, pdf.file, quiet=TRUE){
417417}
418418store(br.rmd2pdf )
419419
420- # # ----br.rmd2both, opts.label='purlme'-----------------------------------------
420+ # # ----br.rmd2both, opts.label='purlme'----------------------------------------------------------------------------------------------
421421br.rmd2both = function (rmd.file , out.dir , quiet = TRUE ){
422422# ## Make an R Markdown file into a PDF and an HTML self-contained file
423423# ## You need BloomR LaTeX addons or the proper BloomR version
@@ -467,7 +467,7 @@ br.rmd2both=function(rmd.file, out.dir, quiet=TRUE){
467467store(br.rmd2both )
468468
469469
470- # # ----br.sample, opts.label='purlme'-------------------------------------------
470+ # # ----br.sample, opts.label='purlme'------------------------------------------------------------------------------------------------
471471br.sample = function (nrow , nsec = 1 , price = TRUE , start = Sys.Date(), mean = ifelse(price , 10 , 0.1 ), sd = 1 ,
472472 jitter = 0 , same.dates = FALSE , no.na = FALSE , df = FALSE , empty.sec = 0 , sec.names = NULL )
473473{
@@ -534,13 +534,13 @@ br.sample=function(nrow, nsec=1, price=TRUE, start=Sys.Date(), mean=ifelse(price
534534}
535535store(br.sample )
536536
537- # # ----deprecated, opts.label='purlme'------------------------------------------
537+ # # ----deprecated, opts.label='purlme'-----------------------------------------------------------------------------------------------
538538bbg.open = function () stop(" Sorry 'bbg.open' is now deprecated. Please use br.open()." )
539539bbg.close = function (con ) stop(" Sorry 'bbg.close' is now deprecated. Please use br.close()." )
540540store(bbg.open )
541541store(bbg.close )
542542
543- # # ----bbg-internal, opts.label='purlme'----------------------------------------
543+ # # ----bbg-internal, opts.label='purlme'---------------------------------------------------------------------------------------------
544544
545545# # Check connection token
546546.br.is.con = function (con ) identical(attr(con , ' jclass' ), " org/findata/blpwrapper/Connection" )
@@ -566,7 +566,7 @@ store(bbg.close)
566566
567567
568568.br.jar = function (){
569- jarpath = dbr.brmain (" /blpapi/bin" )
569+ jarpath = .br.home (" /blpapi/bin" )
570570 Sys.glob(file.path(jarpath , " blpapi-[0-9]*.jar" ))
571571 }
572572
@@ -577,14 +577,14 @@ store(.br.check.type)
577577store(.br.cuttype )
578578store(.br.jar )
579579
580- # # ----connections, opts.label='purlme'-----------------------------------------
580+ # # ----connections, opts.label='purlme'----------------------------------------------------------------------------------------------
581581br.open = function () blpConnect(blpapi.jar.file = .br.jar())
582582br.close = function (conn ) if (! is.null(conn )) blpDisconnect(conn )
583583
584584store(br.open )
585585store(br.close )
586586
587- # # ----miscfunc, opts.label='purlme'--------------------------------------------
587+ # # ----miscfunc, opts.label='purlme'-------------------------------------------------------------------------------------------------
588588
589589# Clean up
590590# # Remove visible and invisible objects
@@ -598,7 +598,7 @@ rm.var=function()
598598store(rm.all )
599599store(rm.var )
600600
601- # # ----betafun, opts.label='purlme'---------------------------------------------
601+ # # ----betafun, opts.label='purlme'--------------------------------------------------------------------------------------------------
602602
603603br.beta = function (){
604604 f = paste0(R.home(" share" ), " /bloomr/bloomr.beta.R" )
@@ -608,7 +608,7 @@ br.beta=function(){
608608store(br.beta )
609609
610610
611- # # ----time, opts.label='purlme'------------------------------------------------
611+ # # ----time, opts.label='purlme'-----------------------------------------------------------------------------------------------------
612612`%+%` <- function (x ,y ) UseMethod(" %+%" )
613613`%+%.Date` <- function (date ,n ) seq(date , by = paste (n , " months" ), length = 2 )[2 ]
614614`%-%` <- function (x ,y ) UseMethod(" %-%" )
@@ -664,7 +664,7 @@ store(last.day)
664664store(day.us )
665665
666666
667- # # ----attach, opts.label='purlme'----------------------------------------------
667+ # # ----attach, opts.label='purlme'---------------------------------------------------------------------------------------------------
668668# ## Make visible br.* in bloomr env and base ns
669669attach(bloomr.usr )
670670rm(store )
0 commit comments