rating_to_char: Converts a vector of numeric ratings produced by...

View source: R/rating_to_char.R

rating_to_charR Documentation

Converts a vector of numeric ratings produced by rating_to_numeric function to a character vector

Description

This function takes a vector of numeric credit ratings and returns a vector of their character equivalents. The package currently supports long term credit ratings from Moody's, S&P, Fitch, Kroll, & DBRS/Morningstar and defaults to return the S/F/K rating values for character equivalents. All mappings are stored in creditor:::cr_imp. Short term ratings are assigned the floor rounded value of their long term equivalents.

Usage

rating_to_char(numeric_rating, agency_convention = "sfk")

Arguments

numeric_rating

A numeric vector of bond credit ratings

agency_convention

Defaults to "sfk" (e.g. BBB+), but can be "m" (e.g. Baa1)

Value

Returns a vector of numeric credit rating equivalents.

Examples


# convert bond credit ratings to numeric values
x <- c(1, 2, 4)
rating_to_char(x)


p-will-b/creditor documentation built on March 28, 2023, 6:46 p.m.