diff --git a/DESCRIPTION b/DESCRIPTION index 71012bf..924bf99 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 @@ -15,7 +15,7 @@ Imports: jsonlite, lubridate, magrittr, - opendatascot, + opendatascot (>= 0.0.0.9000), openxlsx, purrr, readr, @@ -37,3 +37,5 @@ Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 +Remotes: + github::ScotGovAnalysis/opendatascot diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..670e20b --- /dev/null +++ b/NEWS.md @@ -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 diff --git a/tests/testthat/test-add_geography.R b/tests/testthat/test-add_geography.R index 03d1c11..5e24a9c 100644 --- a/tests/testthat/test-add_geography.R +++ b/tests/testthat/test-add_geography.R @@ -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") diff --git a/tests/testthat/test-get_datazone_lookup.R b/tests/testthat/test-get_datazone_lookup.R index fc65abe..55b01fa 100644 --- a/tests/testthat/test-get_datazone_lookup.R +++ b/tests/testthat/test-get_datazone_lookup.R @@ -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") diff --git a/tests/testthat/test-get_simd_lookup.R b/tests/testthat/test-get_simd_lookup.R index e09c339..69cc5ba 100644 --- a/tests/testthat/test-get_simd_lookup.R +++ b/tests/testthat/test-get_simd_lookup.R @@ -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