addCF: Add a Cash Flow record to the Cash Flow data frame

View source: R/aasim_classes.r

addCFR Documentation

Add a Cash Flow record to the Cash Flow data frame

Description

Here are the types that describe when a cash flow starts or ends: yr indicates a numeric value will be supplied such as 1 to start year one and 10 to end year 10. p1age, p2age is the age of person1 or person 2; p1ret, p2ret is the retirement age of person1 or person 2; p1death, p2death is the age at death of person1 or person 2; 1stdeath, 2nddeath is the death of the 1st to die, or the 2nd to die; start is first year (equivalent to startType=='yr' and specifying 1 for the start); end is last year

Usage

addCF(
  simCF,
  description,
  startType,
  start,
  endType,
  end,
  type,
  amount,
  defaultInflationAdj,
  inflation
)

Arguments

simCF

The data frame to which to add a cash flow

description

Description of cash flow

startType

Type of starting period.

start

numeric value representing startType='yr' or 'p1age

endType

Type of ending period.

end

numeric value representing endType='yr' or 'p1age

type

either 'c' for contribution or 'w' for withdrawal

amount

dollar amount of cash flow

defaultInflationAdj

logical to indicate whether cash flow is to be adjusted using the default inflation.

inflation

numeric value representing inflation rate to use if the default rate is not used.

Value

A data frame with the cash flows of the simulation and the added cash flow

Examples

## Not run: simCF <- addCF(simCF, description, startType, start,
                   endType, end, type, amount, defaultInflationAdj)
## End(Not run)
## Not run: simCF <- addCF(simCF, "Retirement Expense", "p1ret", 0,
                   "p1death", 0, "w", 40000, TRUE)
## End(Not run)

rexmacey/aasim documentation built on Oct. 29, 2024, 9:30 a.m.