Skip to content

Commit

Permalink
Reduced size of package
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Jun 19, 2024
1 parent 864b7fa commit ff79dd4
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.1.0
Date: 2024-06-17 07:37:28 UTC
SHA: 0e0efb6723fbd5bfc8ead2e4d9c1610d093b2c77
Date: 2024-06-19 23:42:18 UTC
SHA: 864b7fa1706a857c92f1f52d133dd51b06b070e3
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Improved formatting of vital objects when printed
* Added vital_vars function
* Added age_components methods for FNAIVE and FMEAN models
* Data before 1900 removed from norway_xxx data sets

# vital 1.0.0

Expand Down
6 changes: 3 additions & 3 deletions R/norway.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Norwegian mortality and births data
#'
#' `norway_births` is an annual `vital` object covering the years 1846-2022, as provided
#' `norway_births` is an annual `vital` object covering the years 1900-2022, as provided
#' by the Human Mortality Database on 21 April 2024.
#' @source
#' Human Mortality Database <https://mortality.org>
Expand All @@ -17,7 +17,7 @@
#' # Deaths
#' norway_mortality
#' norway_mortality |>
#' dplyr::filter(Age < 85, Year < 1900, Sex != "Total") |>
#' dplyr::filter(Age < 85, Year < 1950, Sex != "Total") |>
#' autoplot(Mortality) +
#' scale_y_log10()
#' # Fertility
Expand All @@ -40,7 +40,7 @@ NULL

#' Norwegian mortality data
#'
#' `norway_mortality` is an annual `vital` covering the years 1846-2022, as provided
#' `norway_mortality` is an annual `vital` covering the years 1900-2022, as provided
#' by the Human Mortality Database on 21 April 2024.
#'
#' @name norway_mortality
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Fixed issues identified in previous submission

## Test environments

* KDE neon 6.0 based on ubuntu 22.04 (local): R 4.4.0
Expand Down
12 changes: 9 additions & 3 deletions data-raw/norway.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
library(dplyr)

# HMD Norwegian data as downloaded from mortality.org on 21 April 2024
# Only include data from 1900 onwards to keep size down
norway_mortality <- read_hmd_files(here::here("data-raw",c("Population.txt", "Mx_1x1.txt"))) |>
mutate(
Mortality = if_else(is.na(Mortality) & Population == 0, 0, Mortality)
)
norway_births <- read_hmd_files(here::here("data-raw","Births.txt"))
) |>
filter(Year >= 1900)
norway_births <- read_hmd_files(here::here("data-raw","Births.txt")) |>
filter(Year >= 1900)
norway_fertility <- read_hfd_files(here::here("data-raw","NORasfrRR.txt")) |>
rename(Fertility = ASFR)
rename(Fertility = ASFR) |>
filter(Year >= 1900)

usethis::use_data(norway_mortality, overwrite = TRUE)
usethis::use_data(norway_births, overwrite = TRUE)
Expand Down
Binary file modified data/norway_births.rda
Binary file not shown.
Binary file modified data/norway_fertility.rda
Binary file not shown.
Binary file modified data/norway_mortality.rda
Binary file not shown.
6 changes: 3 additions & 3 deletions man/norway_births.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ff79dd4

Please sign in to comment.