Skip to content

Commit

Permalink
Increment version number to 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrace committed Jan 15, 2025
1 parent 94d2179 commit ae4995e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 65 deletions.
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", role = c("aut", "cre")),
person("Department for Education, UK", "[email protected]", role = "cph"),
person("Department for Education, England", , , "[email protected]", role = "cph"),
person("Laura", "Selby", , "[email protected]", role = "aut"),
person("Adam", "Robinson", role = "aut"),
person("Jen", "Machin", , "[email protected]", role = "ctb"),
person("Jake", "Tufts", , "[email protected]", role = "ctb"),
person("Rich", "Bielby", , "[email protected]", role = "ctb",
comment = c(ORCID = "0000-0001-9070-9969")),
person("Menna", "Zayed", , "[email protected]", role = "ctb")
person("Menna", "Zayed", , "[email protected]", role = "ctb"),
person("Lauren", "Snaathorst", , "[email protected]", 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)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion R/z_replace.R
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
}

Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion man/dfeR-package.Rd

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

52 changes: 3 additions & 49 deletions tests/testthat/test-z_replace.R
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand All @@ -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."
)
Expand Down Expand Up @@ -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
Expand All @@ -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))
})

0 comments on commit ae4995e

Please sign in to comment.