Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sssstats
Title: Functions for Social Security Scotland Statisticians
Version: 0.1.0
Version: 0.2.0
Authors@R:
person("Izaak", "Jephson", , "izaak.jephson@socialsecurity.gov.scot", role = c("aut", "cre"))
Description: Useful helper functions designed for use in Social Security
Expand All @@ -15,7 +15,7 @@ Imports:
jsonlite,
lubridate,
magrittr,
opendatascot,
opendatascot (>= 0.0.0.9000),
openxlsx,
purrr,
readr,
Expand All @@ -37,3 +37,5 @@ Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Remotes:
github::ScotGovAnalysis/opendatascot
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# sssstats 0.2.0

* The following new functions have been introduced:

* `get_datazone_lookup()` for creating the data zone lookup from statistics.gov.scot
* `get_simd_lookup()` for creating the Scottish Index of Multiple Deprivation lookup (2011 data zone based) from statistics.gov.scot
* `get_sspl_lookup()` for reading in (a local CSV file of) the Scottish Statistics Postcode Lookup published by National Records of Scotland
* `add_geography()` for adding geography fields into data extracts used for all Social Security Scotland's official statistics publications.

See function documentation for further information.

* Removes a dependency on the `config` R package
5 changes: 5 additions & 0 deletions tests/testthat/test-add_geography.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
test_that("add_geography works", {
# `get_datazone_lookup()` relies on a live SPARQL endpoint and then downloads
# the file from its URL -- this would fail some GitHub Actions for R. So,
# skipping CI if it comes to this.
testthat::skip_on_ci()

# first collect all the lookups
file_path <- testthat::test_path("sspl_data", "singlerecord_mock.csv")

Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-get_datazone_lookup.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
test_that("data zone lookup works", {
# `get_datazone_lookup()` relies on a live SPARQL endpoint and then downloads
# the file from its URL -- this would fail some GitHub Actions for R. So,
# skipping CI if it comes to this.
testthat::skip_on_ci()

dz_2011_lookup <- get_datazone_lookup("2011")
dz_2022_lookup <- get_datazone_lookup("2022")

Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-get_simd_lookup.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
test_that("lookup table for simd made", {
# `get_simd_lookup()` relies on a live SPARQL endpoint and then downloads
# the file from its URL -- this would fail some GitHub Actions for R. So,
# skipping CI if it comes to this.
testthat::skip_on_ci()

simd_data <- get_simd_lookup()

# check if result is a dataframe
Expand Down