data-raw/Update tax tables.R

# PIT_tables ------------------------------------------------------------

# Add data to the package to be available
Tax_tables <- list(PIT_brackets_1996 = matrix(c(0,5000,10000,15000,20000,30000,40000,50000,70000,80000,
                                                0.17,0.18,0.19,0.2,0.21,0.31,0.42,0.43,0.44,0.45), ncol =2),
                   PIT_rebates_1996 = matrix(c(0,65,
                                               2625,2500), ncol = 2),
                   PIT_brackets_1997 = matrix(c(0,15000,20000,30000,40000,60000,80000,100000,
                                                0.17,0.19,0.21,0.3,0.41,0.43,0.44,0.45), ncol =2),
                   PIT_rebates_1997 = matrix(c(0,65,
                                               2660,2500), ncol = 2),
                   PIT_brackets_1998 = matrix(c(0,30000,35000,45000,60000,70000,100000,
                                                0.19,0.3,0.32,0.41,0.43,0.44,0.45), ncol =2),
                   PIT_rebates_1998 = matrix(c(0,65,
                                               3215,2500), ncol = 2),
                   PIT_brackets_1999 = matrix(c(0,31000,46000,60000,70000,120000,
                                                0.19,0.3,0.39,0.43,0.44,0.45), ncol =2),
                   PIT_rebates_1999 = matrix(c(0,65,
                                               3710,2775), ncol = 2),
                   PIT_brackets_2000 = matrix(c(0,33000,50000,60000,70000,120000,
                                                0.19,0.3,0.35,0.4,0.44,0.45), ncol =2),
                   PIT_rebates_2000 = matrix(c(0,65,
                                               3710,2775), ncol = 2),
                   PIT_brackets_2001 = matrix(c(0,35000,45000,60000,70000,200000,
                                                0.18,0.26,0.32,0.37,0.4,0.42), ncol =2),
                   PIT_rebates_2001 = matrix(c(0,65,
                                               3800,2900), ncol = 2),
                   PIT_brackets_2002 = matrix(c(0,38000,55000,80000,100000,215000,
                                                0.18,0.26,0.32,0.37,0.4,0.42), ncol =2),
                   PIT_rebates_2002 = matrix(c(0,65,
                                               4140,3000), ncol = 2),
                   PIT_brackets_2003 = matrix(c(0,40000,80000,110000,170000,240000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2003 = matrix(c(0,65,
                                               4860,3000), ncol = 2),
                   PIT_brackets_2004 = matrix(c(0,70000,110000,140000,180000,255000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2004 = matrix(c(0,65,
                                               5400,3100), ncol = 2),
                   PIT_brackets_2005 = matrix(c(0,74000,115000,155000,195000,270000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2005 = matrix(c(0,65,
                                               5800,3200), ncol = 2),
                   PIT_brackets_2006 = matrix(c(0,80000,130000,180000,230000,300000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2006 = matrix(c(0,65,
                                               6300,4500), ncol = 2),
                   PIT_brackets_2007 = matrix(c(0,100000,160000,220000,300000,400000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2007 = matrix(c(0,65,
                                               7200,4500), ncol = 2),
                   PIT_brackets_2008 = matrix(c(0,112500,180000,250000,350000,450000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2008 = matrix(c(0,65,
                                               7740,4680), ncol = 2),
                   PIT_brackets_2009 = matrix(c(0,122000,195000,270000,380000,490000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2009 = matrix(c(0,65,
                                               8280,5040), ncol = 2),
                   PIT_brackets_2010 = matrix(c(0,132000,210000,290000,410000,525000,
                                                0.18,0.25,0.3,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2010 = matrix(c(0,65,
                                               9756,5400), ncol = 2),
                   PIT_brackets_2011 = matrix(c(0,140000,221000,305000,431000,552000,
                                            0.18,0.25,0.30,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2011 = matrix(c(0,65,
                                           10260,5675), ncol = 2),
                   PIT_brackets_2012 = matrix(c(0,150000,235000,325000,455000,580000,
                                            0.18,0.25,0.30,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2012 = matrix(c(0,65,75,
                                           10755,6012,2000), ncol = 2),
                   PIT_brackets_2013 = matrix(c(0,160000,250000,346000,484000,617000,
                                            0.18,0.25,0.30,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2013 = matrix(c(0,65,75,
                                           11440,6390,2130), ncol = 2),
                   PIT_brackets_2014 = matrix(c(0,165600,258750,358110,500940,638600,
                                            0.18,0.25,0.30,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2014 = matrix(c(0,65,75,
                                           12080,6750,2250), ncol = 2),
                   PIT_brackets_2015 = matrix(c(0,174550,272700,377450,528000,673100,
                                            0.18,0.25,0.30,0.35,0.38,0.4), ncol =2),
                   PIT_rebates_2015 = matrix(c(0,65,75,
                                           12726,7100,2367), ncol = 2),
                   PIT_brackets_2016 = matrix(c(0,181900,284100,393200,550100,701300,
                                            0.18,0.26,0.31,0.36,0.39,0.41), ncol =2),
                   PIT_rebates_2016 = matrix(c(0,65,75,
                                           13257,7407,2466), ncol = 2),
                   PIT_brackets_2017 = matrix(c(0,188000,293600,406400,550100,701300,
                                            0.18,0.26,0.31,0.36,0.39,0.41), ncol =2),
                   PIT_rebates_2017 =  matrix(c(0,65,75,
                                            13500,7407,2466), ncol = 2),
                   PIT_brackets_2018 = matrix(c(0,189880, 296540, 410460, 555600, 708310, 1500000,
                                            0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2018 = matrix(c(0,65,75,
                                           13635,7479,2493), ncol = 2),
                   PIT_brackets_2019 = matrix(c(0,195850, 305850, 423300, 555600, 708310, 1500000,
                                            0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2019 = matrix(c(0,65,75,
                                           14067,7713,2574), ncol = 2),
                   PIT_brackets_2020 = matrix(c(0,195850, 305850, 423300, 555600, 708310, 1500000,
                                            0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2020 = matrix(c(0,65,75,
                                           14220,7794,2601), ncol = 2),
                   PIT_brackets_2021 = matrix(c(0,205900, 321600, 445100, 584200, 744800, 1577300,
                                            0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2021 = matrix(c(0,65,75,
                                           14958, 8199, 2736), ncol = 2),
                   PIT_brackets_2022 = matrix(c(0,216000, 337800, 467500, 613600, 782200, 1656600,
                                                0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2022 = matrix(c(0,65,75,
                                               15714, 8613, 2871), ncol = 2),
                   PIT_brackets_2023 = matrix(c(0,226000, 353100, 488700, 641400, 817600, 1731600,
                                                0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2023 = matrix(c(0,65,75,
                                               16425, 9000, 2997), ncol = 2),
                   PIT_brackets_2024 = matrix(c(0,237100, 370500, 512800, 673000, 857900, 1817000,
                                                0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2024 = matrix(c(0,65,75,
                                               17235, 9444, 3145), ncol = 2),
                   PIT_brackets_2025 = matrix(c(0,237100, 370500, 512800, 673000, 857900, 1817000,
                                                0.18, 0.26, 0.31, 0.36, 0.39, 0.41, 0.45), ncol =2),
                   PIT_rebates_2025 = matrix(c(0,65,75,
                                               17235, 9444, 3145), ncol = 2))

save(Tax_tables, file = "data-raw/SARS/Tax_tables.rda", version = 2)

usethis::use_data(Tax_tables, overwrite = TRUE)

# Changing the data into a dataframe to make it easier to work with
PIT_brackets <- data.frame(rbind(cbind(1996, Tax_tables$PIT_brackets_1996),
                                 cbind(1997, Tax_tables$PIT_brackets_1997),
                                 cbind(1998, Tax_tables$PIT_brackets_1998),
                                 cbind(1999, Tax_tables$PIT_brackets_1999),
                                 cbind(2000, Tax_tables$PIT_brackets_2000),
                                 cbind(2001, Tax_tables$PIT_brackets_2001),
                                 cbind(2002, Tax_tables$PIT_brackets_2002),
                                 cbind(2003, Tax_tables$PIT_brackets_2003),
                                 cbind(2004, Tax_tables$PIT_brackets_2004),
                                 cbind(2005, Tax_tables$PIT_brackets_2005),
                                 cbind(2006, Tax_tables$PIT_brackets_2006),
                                 cbind(2007, Tax_tables$PIT_brackets_2007),
                                 cbind(2008, Tax_tables$PIT_brackets_2008),
                                 cbind(2009, Tax_tables$PIT_brackets_2009),
                                 cbind(2010, Tax_tables$PIT_brackets_2010),
                                 cbind(2011, Tax_tables$PIT_brackets_2011),
                                 cbind(2012, Tax_tables$PIT_brackets_2012),
                                 cbind(2013, Tax_tables$PIT_brackets_2013),
                                 cbind(2014, Tax_tables$PIT_brackets_2014),
                                 cbind(2015, Tax_tables$PIT_brackets_2015),
                                 cbind(2016, Tax_tables$PIT_brackets_2016),
                                 cbind(2017, Tax_tables$PIT_brackets_2017),
                                 cbind(2018, Tax_tables$PIT_brackets_2018),
                                 cbind(2019, Tax_tables$PIT_brackets_2019),
                                 cbind(2020, Tax_tables$PIT_brackets_2020),
                                 cbind(2021, Tax_tables$PIT_brackets_2021),
                                 cbind(2022, Tax_tables$PIT_brackets_2022),
                                 cbind(2023, Tax_tables$PIT_brackets_2023),
                                 cbind(2024, Tax_tables$PIT_brackets_2024),
                                 cbind(2025, Tax_tables$PIT_brackets_2025)))

colnames(PIT_brackets) <- c("Tax_year", "Bracket", "Tax_rate")


PIT_rebates <- data.frame(rbind(cbind(1996, Tax_tables$PIT_rebates_1996),
                                cbind(1997, Tax_tables$PIT_rebates_1997),
                                cbind(1998, Tax_tables$PIT_rebates_1998),
                                cbind(1999, Tax_tables$PIT_rebates_1999),
                                cbind(2000, Tax_tables$PIT_rebates_2000),
                                cbind(2001, Tax_tables$PIT_rebates_2001),
                                cbind(2002, Tax_tables$PIT_rebates_2002),
                                cbind(2003, Tax_tables$PIT_rebates_2003),
                                cbind(2004, Tax_tables$PIT_rebates_2004),
                                cbind(2005, Tax_tables$PIT_rebates_2005),
                                cbind(2006, Tax_tables$PIT_rebates_2006),
                                cbind(2007, Tax_tables$PIT_rebates_2007),
                                cbind(2008, Tax_tables$PIT_rebates_2008),
                                cbind(2009, Tax_tables$PIT_rebates_2009),
                                cbind(2010, Tax_tables$PIT_rebates_2010),
                                cbind(2011, Tax_tables$PIT_rebates_2011),
                                cbind(2012, Tax_tables$PIT_rebates_2012),
                                cbind(2013, Tax_tables$PIT_rebates_2013),
                                cbind(2014, Tax_tables$PIT_rebates_2014),
                                cbind(2015, Tax_tables$PIT_rebates_2015),
                                cbind(2016, Tax_tables$PIT_rebates_2016),
                                cbind(2017, Tax_tables$PIT_rebates_2017),
                                cbind(2018, Tax_tables$PIT_rebates_2018),
                                cbind(2019, Tax_tables$PIT_rebates_2019),
                                cbind(2020, Tax_tables$PIT_rebates_2020),
                                cbind(2021, Tax_tables$PIT_rebates_2021),
                                cbind(2022, Tax_tables$PIT_rebates_2022),
                                cbind(2023, Tax_tables$PIT_rebates_2023),
                                cbind(2024, Tax_tables$PIT_rebates_2024),
                                cbind(2025, Tax_tables$PIT_rebates_2025)))

colnames(PIT_rebates) <- c("Tax_year", "Age", "Rebate")

save(PIT_brackets, file = "data-raw/SARS/PIT_brackets.rda", version = 2)
save(PIT_rebates, file = "data-raw/SARS/PIT_rebates.rda", version = 2)

# Change name
NT_Budget_PIT_brackets <- PIT_brackets
NT_Budget_PIT_rebates <- PIT_rebates

usethis::use_data(NT_Budget_PIT_brackets, overwrite = TRUE)
usethis::use_data(NT_Budget_PIT_rebates, overwrite = TRUE)
chrisaxelson/tax4sa documentation built on July 17, 2025, 5:21 a.m.