Skip to contents

The future value of a one time amount if it were invested instead of spent. From the Budgeting chapter.

Usage

opportunity_cost(amount, rate, years)

Arguments

amount

Amount spent today.

rate

Yearly return, as a decimal.

years

Number of years.

Value

A numeric vector of future values.

Examples

# $1,000 invested at 7% for 30 years
opportunity_cost(amount = 1000, rate = 0.07, years = 30)
#> [1] 7612.255