Learn R Programming

Trading (version 3.2)

HashTable-class: Hashtable Class

Description

Creates a hashtable-like object so as to represent data with a key structure (for example addon tables, rating-based factors etc). Also, it includes methods for populating the object via a .csv file and finding a value based on a specific key on an interval of keys For examples of the format of the CSVs files, please view RatingsMapping.csv or AddonTable.csv on the extdata folder in the installation folder of the library

Value

An object of type HashTable

Arguments

keys

A vector of keys

values

A vector of values mapping to the keys

keys_type

The type of the keys

values_type

The type of the values

Author

Tasos Grivas <tasos@openriskcalculator.com>

Examples

Run this code

## loading a ratings' mapping matrix from the extdata folder
rating_table = HashTable('RatingsMapping.csv',"character","numeric")
reg_weight =rating_table$FindValue("AAA")

Run the code above in your browser using DataLab