plt-methods: Plot a YieldCurve

plot,ContractType,character-methodR Documentation

Plot a YieldCurve

Description

Create a graphical representation of a YieldCurve- object.

Create a graphical representation of an index-like RiskFactor-object.

Usage

## S4 method for signature 'ContractType,character'
plot(x, y, yc = NULL, ...)

## S4 method for signature 'FEMSContract,character'
plot(x, y, yc = NULL, to = NULL, ...)

## S4 method for signature 'EventSeries,character'
plot(x, y, yc = NULL, ...)

## S4 method for signature 'YieldCurve,missing'
plot(x, y, ...)

## S4 method for signature 'RiskFactor,ANY'
plot(x, y, ...)

Arguments

object

The RiskFactor object to plot

See Also

YieldCurve,plot

ReferenceIndex,plot

Examples

yc <- YieldCurve()
tenors <- c("1W", "1M", "6M", "1Y", "2Y", "5Y")
rates <- c(0.001, 0.0015, 0.002, 0.01, 0.02, 0.03)
set(yc, what = list(MarketObjectCode = "YC_Prim",
  Nodes = list(ReferenceDate = "2015-01-01T00", Tenors = tenors, Rates = rates)))
plot(yc)

idx <- Index()
times <- c("2015-01-01T00", "2016-01-01T00", "2017-01-01T00", "2018-01-01T00",
           "2019-01-01T00")
values <- c(100, 110, 120, 130, 140)
set(idx, what=list(
  MarketObjectCode = "IND_CPI_EA",
  Data=list(Dates=times,Values=values)))
plot(idx)


wbreymann/FEMS documentation built on Dec. 8, 2022, 9:43 a.m.