Learn R Programming

R4GoodPersonalFinances (version 1.2.0)

calc_effective_tax_rate: Calculate Effective Tax Rate

Description

Calculate Effective Tax Rate

Usage

calc_effective_tax_rate(portfolio, tax_rate_ltcg, tax_rate_ordinary_income)

Value

A portfolio object augmented with nested columns with effective tax rates calculations.

Arguments

portfolio

A nested tibble of class Portfolio.

tax_rate_ltcg

A numeric. Tax rate for long-term capital gains.

tax_rate_ordinary_income

A numeric. Tax rate for ordinary income.

Examples

Run this code
 portfolio <- create_portfolio_template()
 portfolio$accounts$taxable <- c(10000, 30000)
 portfolio <- 
   calc_effective_tax_rate(
     portfolio,
     tax_rate_ltcg = 0.20, 
     tax_rate_ordinary_income = 0.40
   )
 portfolio$aftertax$effective_tax_rate 

Run the code above in your browser using DataLab