Created
June 6, 2017 03:49
-
-
Save thmcmahon/a051c18ddde40e11136c3d89aaffd313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
medicare_levy <- function(income, rate = .02, taper_threshold_lower = 21335, taper_threshold_upper = 26668) { | |
if (income < taper_threshold_lower) { | |
# People earning below the low income threshold pay no tax | |
return(0) | |
} else if (income >= taper_threshold_lower & income <= taper_threshold_upper) { | |
# People earning income that is between the taper thresholds pay 10 cents for each dollar over the low income threshold | |
return((income - taper_threshold_lower) * .1) | |
} else { | |
# People above the upper taper threshold pay the standard medicare levy | |
return(income * rate) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment