diff --git a/R/project.R b/R/project.R index 1667a75c7..69cab9802 100644 --- a/R/project.R +++ b/R/project.R @@ -85,7 +85,8 @@ project <- function(sample_file, .copyDT = TRUE, check_fy_sample_file = TRUE, differentially_uprate_Sw = NA, - r_super_balance = 1.05) { + r_super_balance = 1.05, + r_generic = 1) { if (length(h) != 1L) { stop("`h` had length-", length(h), ", ", "but must be a length-1 positive integer.") @@ -138,7 +139,7 @@ project <- function(sample_file, # without updating the fy.year.of.sample.file if (is.null(fy.year.of.sample.file)) { fy.year.of.sample.file <- - match(nrow(sample_file), c(254318L, 258774L, 263339L, 269639L, 277202L, 284925L)) + match(nrow(sample_file), c(254318L, 258774L, 263339L, 269639L, 277202L, 284925L, 301687L)) if (is.na(fy.year.of.sample.file)) { stop("`fy.year.of.sample.file` was not provided, and its value could not be ", "inferred from nrow(sample_file) = ", nrow(sample_file), ". Either use ", @@ -146,7 +147,7 @@ project <- function(sample_file, "supply `fy.year.of.sample.file` manually.") } fy.year.of.sample.file <- - c("2012-13", "2013-14", "2014-15", "2015-16", "2016-17", "2017-18")[fy.year.of.sample.file] + c("2012-13", "2013-14", "2014-15", "2015-16", "2016-17", "2017-18", "2020-21")[fy.year.of.sample.file] } @@ -181,6 +182,11 @@ project <- function(sample_file, warning("nrow(sample_file) != 284925. Should you choose a different fy.year.of.sample.file?") } }, + "2020-21" = { + if (nrow(sample_file) != 301687) { + warning("nrow(sample_file) != 301687 Should you choose a different fy.year.of.sample.file?") + } + }, stop("`fy.year.of.sample.file` must be '2012-13', '2013-14', '2014-15', '2015-16', '2016-17', or '2017-18'.")) } @@ -454,7 +460,11 @@ project <- function(sample_file, }, "generic" = { if (.recalculate.inflators) { - generic.inflators[variable == j]$inflator * v + if (nrow(generic.inflators)) { + generic.inflators[variable == j]$inflator * v + } else { + v + } } else { generic.inflators[.(H, j), inflator] * v } diff --git a/data-raw/put-data.R b/data-raw/put-data.R index af8d388a8..82a29210c 100644 --- a/data-raw/put-data.R +++ b/data-raw/put-data.R @@ -992,6 +992,13 @@ Age_pension_deeming_rates_by_Date <- .[, type := gsub("_", " ", gsub("threshold_", "", type, fixed = TRUE))] %>% .[, .(Date, type, threshold, deeming_rate_below, deeming_rate_above)] +aus_delta <- + abs31[series_id %chin% c("A2133244X", "A2133245A", "A2133252X", "A2133246C", "A2133247F", "A2133248J")] %>% + drop_constant_cols %>% + .[, title := gsub(" ", "", trim_common_affixes(series))] %>% + .[] + .[, .(date, )] + aus_pop <- readabs::read_abs("3101.0", table = 59) # aus_pop_all <- readabs::read_abs("3101.0", check_local = FALSE) diff --git a/man/apply_super_caps_and_div293.Rd b/man/apply_super_caps_and_div293.Rd index 7fefc8312..836f698d9 100644 --- a/man/apply_super_caps_and_div293.Rd +++ b/man/apply_super_caps_and_div293.Rd @@ -9,7 +9,7 @@ apply_super_caps_and_div293( colname_concessional = "concessional_contributions", colname_div293_tax = "div293_tax", colname_new_Taxable_Income = "Taxable_income_for_ECT", - div293_threshold = 3e+05, + div293_threshold = 300000, cap = 30000, cap2 = 35000, age_based_cap = TRUE, diff --git a/man/inverse_average_rate.Rd b/man/inverse_average_rate.Rd index 478d34ec5..7470af998 100644 --- a/man/inverse_average_rate.Rd +++ b/man/inverse_average_rate.Rd @@ -4,7 +4,7 @@ \alias{inverse_average_rate} \title{Inverse average tax rate} \usage{ -inverse_average_rate(average_rate, ..., .max = 1e+08) +inverse_average_rate(average_rate, ..., .max = 100000000) } \arguments{ \item{average_rate}{The average tax rate (\eqn{\frac{tax}{income}})} diff --git a/man/model_new_caps_and_div293.Rd b/man/model_new_caps_and_div293.Rd index 69a16fb1a..98c353e32 100644 --- a/man/model_new_caps_and_div293.Rd +++ b/man/model_new_caps_and_div293.Rd @@ -15,7 +15,7 @@ model_new_caps_and_div293( new_cap2_age = 49, new_ecc = FALSE, new_contr_tax = "15\%", - new_div293_threshold = 3e+05, + new_div293_threshold = 300000, use_other_contr = FALSE, scale_contr_match_ato = FALSE, .lambda = 0, @@ -29,7 +29,7 @@ model_new_caps_and_div293( prv_age_based_cap = TRUE, prv_cap2_age = 49, prv_ecc = FALSE, - prv_div293_threshold = 3e+05 + prv_div293_threshold = 300000 ) n_affected_from_new_cap_and_div293(..., adverse_only = TRUE) diff --git a/man/project.Rd b/man/project.Rd index fabbec453..0a1e35559 100644 --- a/man/project.Rd +++ b/man/project.Rd @@ -18,7 +18,8 @@ project( .copyDT = TRUE, check_fy_sample_file = TRUE, differentially_uprate_Sw = NA, - r_super_balance = 1.05 + r_super_balance = 1.05, + r_generic = 1 ) } \arguments{