Learn R Programming

RblDataLicense (version 0.2.6)

RblParse: Parse Bloomberg response file and import data

Description

Parse Bloomberg local response files and import the data in R. The PROGRAMNAME in use is auto detected: 'getdata' and 'gethistory' are supported.

Usage

RblParse(file, auto.assign = FALSE, env = parent.frame(), verbose = TRUE)

Value

PROGRAMNAME=getdata

data.frame containing identifiers (rows) and fields (columns). NULL on failure.

PROGRAMNAME=gethistory

list of xts objects. If auto.assign=TRUE the xts objects are loaded in env and the object names are returned. NULL on failure.

Arguments

file

character string representing the local file to parse (see RblDownload)

auto.assign

logical. Should results be loaded to env when using PROGRAMNAME=gethistory?

env

where to create objects if auto.assign = TRUE

verbose

logical. Should R report extra information on progress?

Examples

Run this code
if (FALSE) {
# 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)

# Import the data
data <- RblParse(out)
str(data)
}

Run the code above in your browser using DataLab