get_dur_bbg: Get time-series duration of asset from Bloomberg. It is a...

get_dur_bbgR Documentation

Get time-series duration of asset from Bloomberg. It is a generic function which means new duration functions can be easily added for new assets

Description

Get time-series duration of asset from Bloomberg. It is a generic function which means new duration functions can be easily added for new assets

Usage

get_dur_bbg(instruments_df, start_date = as.Date("1994-01-01"),
  end_date = today(), fill = TRUE)

Arguments

instruments_df

A dataframe containing the columns 'identifier' and 'asset_class'

start_date

A Date variable

end_date

A Date variable

fill

A boolean indicating whether NAs in the data should be filled, data is only filled upwards

Value

A dataframe containing the the time-series duration of the assets, with the identifier as the name

Examples


inst <- data.frame(asset_class = c("ilb", "govt", "fut", "cds"),
   identifier = c("germany_ilb_5y", "us_govt_10y", "fut_rx1", "cdx_us_ig"),
   stringsAsFactors = FALSE)
get_dur_bbg(inst)


yunching/tidymas documentation built on Feb. 5, 2023, 1:42 p.m.