knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

lookthrough

CRAN status lifecycle AppVeyor build status Travis build status Coverage status

The goal of lookthrough is to help to view the assets exposure using the look-through approach.

Installation

devtools::install_github("shrektan/lookthrough")

Example

library(lookthrough)
data(lkthr_sample)
ptfs <- as_lkthr(lkthr_sample$ptfs)
funds <- as_lkthr(lkthr_sample$funds)
lkthr_match(ptfs, funds)
lkthr_set(ptfs, lkthr_sample$attributes)
print(ptfs, "exposure", "issuer", "guarantor")
plot(ptfs)

ptfs-plot

company_a <- lkthr_filter(ptfs, function(node) { "company_a" %in% node$issuer })
print(company_a, "issuer", "exposure")
data.tree::Aggregate(company_a, "exposure", sum)
company_a$ptf1$exposure
plot(company_a)

issuer-plot



shrektan/lookthrough documentation built on March 29, 2021, 12:07 p.m.