RblDownload: Download a file from Bloomberg

View source: R/core.R

RblDownloadR Documentation

Download a file from Bloomberg

Description

Download a generic file from Bloomberg. Use RblFiles to list the files available at Bloomberg. If the file is not available yet (i.e. a request file has just been uploaded), the function waits until the response file is there or the timeout is reached

Usage

RblDownload(file, frequency = 60, timeout = 3600, verbose = TRUE)

Arguments

file

character string representing the file to download

frequency

the polling frequency to check if file is available at Bloomberg

timeout

the timeout in seconds

verbose

logical. Should R report extra information on progress?

Value

character string. Path to the downloaded file. NULL on failure

Examples

## Not run: 
# Run RblConnect first

# Build a request file to download the daily closing prices of 
#  EURO STOXX Index from 2005-01-01 to 2015-12-31.
RblRequest <- 
     RblRequestBuilder(
          header = c(FIRMNAME = RblUser(), 
                     PROGRAMNAME = 'gethistory', 
                     DATERANGE = '20050101|20151231'),
          fields = c('PX_LAST'), 
          identifiers = c('SXXE Index')
     )
                                
# Upload the request file
req <- RblUpload(RblRequest)

# Download the response file
out <- RblDownload(req$out)
out

## End(Not run)


RblDataLicense documentation built on March 31, 2023, 10:13 p.m.