# Example usage of the discount_vector function
# Calculate the discount vector for 5 years, a discount rate of 0.015, first year is not discounted
discount_vector(discount_rate = 0.015, end_time = 5, time_unit = "years")
# Calculate the discount vector for 60 months, a start time of 2, the first year is not discounted
discount_vector(discount_rate = 0.03, start_time = 2, end_time = 60, time_unit = "months")
# Calculate the discount vector for 365 days, a discount rate of 0.06, the first year is discounted
discount_vector(discount_rate = 0.06, end_time = 365, time_unit = "days", discount_year_one = TRUE)
Run the code above in your browser using DataLab