Learn R Programming

cascsim (version 0.4)

shiftIndex: Shift monthly index with a new start date and replace the unknown index value with zero.

Description

Shift monthly index with a new start date and replace the unknown index value with zero.

Usage

shiftIndex(object, ...)

# S4 method for Index shiftIndex(object, newStartDate, endDate)

Arguments

object

Index Object

...

Additional function arguments

newStartDate

new start date

endDate

end date

Examples

Run this code
# NOT RUN {
xindex <- new("Index", indexID = "IDX1", tabulate = FALSE, annualizedRate = 0.03)
xindex<-setIndex(xindex)
xindex@monthlyIndex
shiftIndex(xindex,as.Date("2016-10-15"),as.Date("2018-10-15"))
shiftIndex(xindex,as.Date("2010-10-15"),as.Date("2013-10-15"))
# }

Run the code above in your browser using DataLab