Skip to content

Commit 9448610

Browse files
authored
Merge pull request #206 from HughParsonage/fys
Fys + newdata
2 parents 2de55dd + db798ce commit 9448610

File tree

143 files changed

+19794
-16286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+19794
-16286
lines changed

CRAN-RELEASE

Lines changed: 0 additions & 2 deletions
This file was deleted.

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: grattan
22
Type: Package
33
Title: Australian Tax Policy Analysis
44
Version: 1.8.0.0
5-
Date: 2019-11-02
5+
Date: 2019-11-16
66
Authors@R: c(person("Hugh", "Parsonage", role = c("aut", "cre"), email = "hugh.parsonage@gmail.com"),
77
person("Tim", "Cameron", role = "aut"),
88
person("Brendan", "Coates", role = "aut"),

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
#> Error: `x = "foo"` was not a valid financial year.
1717
```
1818

19+
### Data
20+
21+
* Update wage and labour force data
22+
23+
1924

2025

2126

R/aus_pop_qtr_age.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#' @export
1313

1414
aus_pop_qtr_age <- function(date = NULL, age = NULL, tbl = FALSE, roll = TRUE, roll.beyond = FALSE) {
15-
if (!is.null(date)){
16-
stopifnot(all(inherits(date, "Date")))
15+
if (!is.null(date)) {
16+
date <- as.Date(date)
1717

1818
if (length(date) > length(age)) {
1919
if (length(age) > 1L) {
@@ -31,28 +31,28 @@ aus_pop_qtr_age <- function(date = NULL, age = NULL, tbl = FALSE, roll = TRUE, r
3131
}
3232
}
3333

34-
if (!is.null(age)){
34+
if (!is.null(age)) {
3535
stopifnot(is.numeric(age),
36-
all(age >= 0),
37-
all(age <= 100))
36+
min(age, na.rm = TRUE) >= 0L,
37+
max(age, na.rm = TRUE) <= 100L)
3838
}
3939

40-
if (AND(NEITHER(identical(roll, FALSE),
40+
if (AND(NEITHER(isFALSE(roll),
4141
roll.beyond),
4242
NEITHER(is.null(date),
4343
all(date %between% range(aust_pop_by_age_yearqtr[["Date"]]))))) {
4444
warning("Rolling join used beyond the limit of data.")
4545
}
4646
# CRAN note avoidance
4747
Date <- Age <- Value <- NULL
48-
if (is.null(date)){
49-
if (is.null(age)){
48+
if (is.null(date)) {
49+
if (is.null(age)) {
5050
out <- aust_pop_by_age_yearqtr
5151
} else {
5252
out <- aust_pop_by_age_yearqtr[Age %in% age]
5353
}
5454
} else {
55-
if (is.null(age)){
55+
if (is.null(age)) {
5656
input <-
5757
data.table(Date = date,
5858
Age = seq_len(100),
@@ -79,7 +79,7 @@ aus_pop_qtr_age <- function(date = NULL, age = NULL, tbl = FALSE, roll = TRUE, r
7979
out[, ordering := NULL]
8080
}
8181

82-
if (tbl){
82+
if (tbl) {
8383
return(out[])
8484
} else {
8585
return(out[["Value"]])

R/fy.year.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ fy.year <- function(yr_ending) {
4242
paste0(as.integer(yr_ending) - 1, "-", substr(yr_ending, 3, 4))
4343
}
4444

45-
yr2fy <- fy::yr2fy
45+
yr2fy <- function(...) as.character(fy::yr2fy(...))
4646
fy2yr <- fy::fy2yr
4747
fy2date <- fy::fy2date
48-
date2fy <- fy::date2fy
49-
qtr2fy <- fy::qtr2fy
48+
date2fy <- function(...) as.character(fy::date2fy(...))
49+
qtr2fy <- function(...) as.character(fy::qtr2fy(...))
50+
5051

5152
max_fy2yr <- function(x) fy2yr(max(x))
5253
min_fy2yr <- function(x) fy2yr(min(x))

R/lf_inflator.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#' If the SDMX connection fails, a message is emitted (not a warning) and
1616
#' the function contines as if \code{useABSConnection = FALSE}.
1717
#'
18-
#' The internal data was updated on 2019-10-29 to 2019-09-01.
18+
#' The internal data was updated on 2019-11-15 to 2019-10-01.
1919
#' @param allow.projection Logical. Should projections be allowed?
2020
#' @param use.month An integer (corresponding to the output of \code{data.table::month}) representing the month of the series used for the inflation.
2121
#' @param forecast.series Whether to use the forecast mean, or the upper or lower boundaries of the prediction intervals.
@@ -43,7 +43,9 @@
4343
#' forecast.series = "custom",
4444
#' lf.series = data.table(fy_year = c("2018-19", "2019-20"),
4545
#' r = c(0, 0.01)))
46-
#' @return The relative labour force between \code{to_date} and \code{for_date} or \code{to_fy} and \code{from_fy}, multiplied by \code{labour_force}.
46+
#' @return The relative labour force between \code{to_date} and \code{for_date}
47+
#' or \code{to_fy} and \code{from_fy}, multiplied by \code{labour_force}.
48+
#'
4749
#' @export lf_inflator lf_inflator_fy
4850

4951
lf_inflator_fy <- function(labour_force = 1,

R/sysdata.rda

-1.45 KB
Binary file not shown.

R/wage_inflator.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' If the SDMX connection fails, a message is emitted (not a warning) and
1111
#' the function contines as if \code{useABSConnection = FALSE}.
1212
#'
13-
#' The internal data was updated on 2019-10-29 to 2019-Q2.
13+
#' The internal data was updated on 2019-11-15 to 2019-Q3.
1414
#' @param allow.projection If set to \code{TRUE} the \code{forecast} package is used to project forward, if required.
1515
#' @param forecast.series Whether to use the forecast mean, or the upper or lower boundaries of the prediction intervals. A fourth option \code{custom} allows manual forecasts to be set.
1616
#' @param forecast.level The prediction interval to be used if \code{forecast.series} is \code{upper} or \code{lower}.
@@ -53,15 +53,15 @@ wage_inflator <- function(wage = 1,
5353
# CRAN
5454
obsTime <- obsValue <- to_index <- from_index <- NULL
5555

56-
if (is.null(from_fy) && is.null(to_fy)){
56+
if (is.null(from_fy) && is.null(to_fy)) {
5757
to_fy <- date2fy(Sys.Date())
5858
from_fy <- prev_fy(to_fy)
5959
warning("`from_fy` and `to_fy` are missing, using previous and current financial years respectively")
6060
}
61-
if (is.null(from_fy)){
61+
if (is.null(from_fy)) {
6262
stop("`from_fy` is missing, with no default.")
6363
}
64-
if (is.null(to_fy)){
64+
if (is.null(to_fy)) {
6565
stop("`to_fy` is missing, with no default.")
6666
}
6767

cran-comments.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
This is a package resubmission after archival.
2-
3-
The vignettes have been protected from accessing taxstats packages; the packages
4-
will only be attempted to be installed if an environment variable is set.
1+
This is a package update
52

63
## Test results
74
0 ERRORS | 0 WARNINGS | 1-2 NOTEs
85

96
### Test environments:
10-
* Local Windows CRAN 3.6.0
7+
* Local Windows CRAN 3.6.1
118
* Travis-CI: Ubuntu 14.04. R 3.5, 3.6, and dev (r76539)
129
* Appveyor: dev (r76446) and release.
1310
* winbuilder: dev (r76539) and release.

data-raw/cpi-seasonally-adjusted-manual.tsv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ obsTime obsValue
124124
2017-Q2 110.9
125125
2017-Q3 111.3
126126
2017-Q4 112
127-
2018-Q1 112.7
127+
2018-Q1 112.6
128128
2018-Q2 113.2
129129
2018-Q3 113.5
130130
2018-Q4 114
131131
2019-Q1 114.1
132132
2019-Q2 115
133+
2019-Q3 115.4

0 commit comments

Comments
 (0)