diff --git a/DESCRIPTION b/DESCRIPTION index c055df2..c023d75 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,23 +1,25 @@ Type: Package Package: dfeR Title: Common Department for Education Analysis Tasks -Version: 1.0.0 +Version: 1.0.1 Authors@R: c( person("Cam", "Race", , "cameron.race@education.gov.uk", role = c("aut", "cre")), - person("Department for Education, UK", "statistics.development@education.gov.uk", role = "cph"), + person("Department for Education, England", , , "statistics.development@education.gov.uk", role = "cph"), person("Laura", "Selby", , "laura.selby@education.gov.uk", role = "aut"), person("Adam", "Robinson", role = "aut"), person("Jen", "Machin", , "jen.machin@education.gov.uk", role = "ctb"), person("Jake", "Tufts", , "jake.tufts@education.gov.uk", role = "ctb"), person("Rich", "Bielby", , "richard.bielby@education.gov.uk", role = "ctb", comment = c(ORCID = "0000-0001-9070-9969")), - person("Menna", "Zayed", , "menna.zayed@education.gov.uk", role = "ctb") + person("Menna", "Zayed", , "menna.zayed@education.gov.uk", role = "ctb"), + person("Lauren", "Snaathorst", , "lauren.snaathorst@education.gov.uk", role = "ctb") ) Description: Preferred methods for common analytical tasks that are undertaken across the Department, including number formatting, project templates and curated reference data. License: GPL (>= 3) -URL: https://dfe-analytical-services.github.io/dfeR/, https://github.com/dfe-analytical-services/dfeR +URL: https://dfe-analytical-services.github.io/dfeR/, + https://github.com/dfe-analytical-services/dfeR BugReports: https://github.com/dfe-analytical-services/dfeR/issues Depends: R (>= 2.10) diff --git a/NEWS.md b/NEWS.md index 1cabb7f..9dc5187 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# dfeR 1.0.1 + +Fix the spacing and printing of the z_replace() warning message, updating the eesyapi URL in the README and removed extraneous package tests. + # dfeR 1.0.0 Initial CRAN release. diff --git a/R/z_replace.R b/R/z_replace.R index 06c1d1e..7c27558 100644 --- a/R/z_replace.R +++ b/R/z_replace.R @@ -87,7 +87,7 @@ z_replace <- function(data, stop( "Your table has geography and/or time column(s) that are not ", "in snake_case.\nPlease amend your column names to match the formatting", - "to dfeR::geog_time_identifiers." + " of dfeR::geog_time_identifiers." ) } diff --git a/README.Rmd b/README.Rmd index 9821112..5c6543e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -44,7 +44,7 @@ Documentation for what has been included in the package so far is on our [pkgdow We also maintain the [dfeshiny](https://github.com/dfe-analytical-services/dfeshiny) package, and expect any functions specific to R Shiny applications will live there. -For connecting to data in the [explore education statistics](https://explore-education-statistics.service.gov.uk/), we are building the [eesyapi](https://github.com/dfe-analytical-services/eesyapi) package. +For connecting to data in the [explore education statistics](https://explore-education-statistics.service.gov.uk/), we are building the [eesyapi](https://github.com/dfe-analytical-services/eesyapi.R) package. There is a [giasr](https://github.com/dfe-analytical-services/giasr) package, which has been developed for connecting to data in the [get information about schools service](https://get-information-schools.service.gov.uk/). diff --git a/README.md b/README.md index 39fd4d8..5be6f02 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ there. For connecting to data in the [explore education statistics](https://explore-education-statistics.service.gov.uk/), we are building the -[eesyapi](https://github.com/dfe-analytical-services/eesyapi) package. +[eesyapi](https://github.com/dfe-analytical-services/eesyapi.R) package. There is a [giasr](https://github.com/dfe-analytical-services/giasr) package, which has been developed for connecting to data in the [get diff --git a/cran-comments.md b/cran-comments.md index 149b0e1..5bdf9eb 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,12 +1,7 @@ ## R CMD check results -0 errors | 0 warnings | 1 note +0 errors | 0 warnings | 1 notes -* This is a new release. +This submission follows the initial publishing of the package 2 days ago, and fixes the issues raised by the CRAN team. -Initial submission was on 2025-08-01, this is a resubmission after fixing the issues raised by the CRAN team. - -* changed cat() to message() to allow suppression of messages -* removed a spurious if(interactive()){} wrapper in one of the examples -* added a missing return value in function documentation -* reformat URL in DESCRIPTION +* removed package tests that tested the speed of function execution diff --git a/man/dfeR-package.Rd b/man/dfeR-package.Rd index 74f2655..f4e2ff5 100644 --- a/man/dfeR-package.Rd +++ b/man/dfeR-package.Rd @@ -30,11 +30,12 @@ Authors: Other contributors: \itemize{ - \item Department for Education, UK statistics.development@education.gov.uk [copyright holder] + \item Department for Education, England \email{statistics.development@education.gov.uk} [copyright holder] \item Jen Machin \email{jen.machin@education.gov.uk} [contributor] \item Jake Tufts \email{jake.tufts@education.gov.uk} [contributor] \item Rich Bielby \email{richard.bielby@education.gov.uk} (\href{https://orcid.org/0000-0001-9070-9969}{ORCID}) [contributor] \item Menna Zayed \email{menna.zayed@education.gov.uk} [contributor] + \item Lauren Snaathorst \email{lauren.snaathorst@education.gov.uk} [contributor] } } diff --git a/tests/testthat/test-z_replace.R b/tests/testthat/test-z_replace.R index e8559c7..2783fcf 100644 --- a/tests/testthat/test-z_replace.R +++ b/tests/testthat/test-z_replace.R @@ -56,7 +56,7 @@ test_that("Error messages are as expected in non-empty frames", { # testing error for non character strings in replacement_alt expect_error( z_replace(df, replacement_alt = 1), - cat( + paste0( "You provided a numeric input for replacement_alt.\n", "Please amend replace it with a character vector." ) @@ -65,7 +65,7 @@ test_that("Error messages are as expected in non-empty frames", { # testing error for multiple vectors in replacement_alt expect_error( z_replace(df, replacement_alt = c("a", "z", "x")), - cat( + paste0( "You provided multiple values for replacement_alt.\n", "Please, only provide a single value." ) @@ -103,45 +103,6 @@ test_that("exclude_columns works", { )) }) - -# Checking speed of the function - -# make this reproducible -set.seed(123) -# create table with randomly generated numbers -df <- data.frame( - a = sample(1:1000, 10000, replace = TRUE), - b = sample(1:1000, 10000, replace = TRUE), - c = sample(1:1000, 10000, replace = TRUE), - d = sample(1:1000, 10000, replace = TRUE), - e = sample(1:1000, 10000, replace = TRUE), - f = sample(1:1000, 10000, replace = TRUE), - e = sample(1:1000, 10000, replace = TRUE), - h = sample(1:1000, 10000, replace = TRUE), - i = sample(1:1000, 10000, replace = TRUE), - j = sample(1:1000, 10000, replace = TRUE), - school_urn = sample(1:1000, 10000, replace = TRUE) -) - -# putting NAs in the table -df <- df %>% - dplyr::mutate(across( - a:school_urn, - ~ dplyr::if_else(. < 300, as.double(NA), .) - )) - -start_time <- Sys.time() -z_replace(df) -end_time <- Sys.time() -test_time <- difftime(end_time, start_time, units = "secs") - -# calculating the time it takes - -# testing that the speed is less than 0.25 second -test_that("Speed of the function", { - expect_equal(test_time < 0.25, TRUE) -}) - # Check error message for empty data frame # create table @@ -166,12 +127,5 @@ df <- data.frame( ) test_that("Formatting of column names are checked", { - expect_error( - z_replace(df), - cat( - "Your table has geography and/or time column(s) that are not", - "in snake_case.\nPlease amend your column names to match the formatting", - "to dfeR::geog_time_identifiers." - ) - ) + expect_error(z_replace(df)) })