Skip to content

Commit 9d04aa7

Browse files
committed
Provisional commit for project_
1 parent 01e47b2 commit 9d04aa7

File tree

6 files changed

+27
-9
lines changed

6 files changed

+27
-9
lines changed

R/project.R

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ project <- function(sample_file,
8585
.copyDT = TRUE,
8686
check_fy_sample_file = TRUE,
8787
differentially_uprate_Sw = NA,
88-
r_super_balance = 1.05) {
88+
r_super_balance = 1.05,
89+
r_generic = 1) {
8990
if (length(h) != 1L) {
9091
stop("`h` had length-", length(h), ", ",
9192
"but must be a length-1 positive integer.")
@@ -138,15 +139,15 @@ project <- function(sample_file,
138139
# without updating the fy.year.of.sample.file
139140
if (is.null(fy.year.of.sample.file)) {
140141
fy.year.of.sample.file <-
141-
match(nrow(sample_file), c(254318L, 258774L, 263339L, 269639L, 277202L, 284925L))
142+
match(nrow(sample_file), c(254318L, 258774L, 263339L, 269639L, 277202L, 284925L, 301687L))
142143
if (is.na(fy.year.of.sample.file)) {
143144
stop("`fy.year.of.sample.file` was not provided, and its value could not be ",
144145
"inferred from nrow(sample_file) = ", nrow(sample_file), ". Either use ",
145146
"a 2% sample file of the years 2012-13, 2013-14, or 2014-15 or ",
146147
"supply `fy.year.of.sample.file` manually.")
147148
}
148149
fy.year.of.sample.file <-
149-
c("2012-13", "2013-14", "2014-15", "2015-16", "2016-17", "2017-18")[fy.year.of.sample.file]
150+
c("2012-13", "2013-14", "2014-15", "2015-16", "2016-17", "2017-18", "2020-21")[fy.year.of.sample.file]
150151
}
151152

152153

@@ -181,6 +182,11 @@ project <- function(sample_file,
181182
warning("nrow(sample_file) != 284925. Should you choose a different fy.year.of.sample.file?")
182183
}
183184
},
185+
"2020-21" = {
186+
if (nrow(sample_file) != 301687) {
187+
warning("nrow(sample_file) != 301687 Should you choose a different fy.year.of.sample.file?")
188+
}
189+
},
184190
stop("`fy.year.of.sample.file` must be '2012-13', '2013-14', '2014-15', '2015-16', '2016-17',
185191
or '2017-18'."))
186192
}
@@ -454,7 +460,11 @@ project <- function(sample_file,
454460
},
455461
"generic" = {
456462
if (.recalculate.inflators) {
457-
generic.inflators[variable == j]$inflator * v
463+
if (nrow(generic.inflators)) {
464+
generic.inflators[variable == j]$inflator * v
465+
} else {
466+
v
467+
}
458468
} else {
459469
generic.inflators[.(H, j), inflator] * v
460470
}

data-raw/put-data.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,13 @@ Age_pension_deeming_rates_by_Date <-
992992
.[, type := gsub("_", " ", gsub("threshold_", "", type, fixed = TRUE))] %>%
993993
.[, .(Date, type, threshold, deeming_rate_below, deeming_rate_above)]
994994

995+
aus_delta <-
996+
abs31[series_id %chin% c("A2133244X", "A2133245A", "A2133252X", "A2133246C", "A2133247F", "A2133248J")] %>%
997+
drop_constant_cols %>%
998+
.[, title := gsub(" ", "", trim_common_affixes(series))] %>%
999+
.[]
1000+
.[, .(date, )]
1001+
9951002
aus_pop <- readabs::read_abs("3101.0", table = 59)
9961003
# aus_pop_all <- readabs::read_abs("3101.0", check_local = FALSE)
9971004

man/apply_super_caps_and_div293.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/inverse_average_rate.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/model_new_caps_and_div293.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/project.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)