Skip to content

Commit 4fc3b75

Browse files
authored
Merge pull request #464 from UCD-SERG/CRAN-fix-release-1.3.0
Cran fix release 1.3.0
2 parents bab8f09 + 20a81c8 commit 4fc3b75

31 files changed

Lines changed: 148 additions & 47 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ NEWS_files
2222
**/.quarto/
2323
*.pdf
2424
junit.xml
25+
26+
**/*.quarto_ipynb

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: serocalculator
33
Title: Estimating Infection Rates from Serological Data
4-
Version: 1.3.0.9059
4+
Version: 1.3.0.9061
55
Authors@R: c(
66
person("Peter", "Teunis", , "p.teunis@emory.edu", role = c("aut", "cph"),
77
comment = "Author of the method and original code."),
@@ -76,4 +76,4 @@ Language: en-US
7676
LazyData: true
7777
NeedsCompilation: no
7878
Roxygen: list(markdown = TRUE, roclets = c("collate", "rd", "namespace", "devtag::dev_roclet"))
79-
RoxygenNote: 7.3.2
79+
RoxygenNote: 7.3.3

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export(est.incidence)
2727
export(est.incidence.by)
2828
export(est_seroincidence)
2929
export(est_seroincidence_by)
30+
export(expect_snapshot_data)
3031
export(f_dev)
3132
export(f_dev0)
3233
export(fdev)

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ would get merged by `ggplot2::aes(group = iter)` (#382)
6161

6262
## Internal changes
6363

64+
* switched `expect_snapshot_data()` to an internal function due to CRAN errors (#464)
6465
* generalized `ab1()`
6566
* added codecov/test-results-action to test-coverage.yaml workflow
6667
* added test for censored data in f_dev() (#399)

R/check_strata.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#' sees_pop_data_pk_100 |>
1111
#' check_strata(strata = c("ag", "catch", "Count")) |>
1212
#' try()
13-
#' @dev
13+
#' @keywords internal
1414
check_strata <- function(pop_data,
1515
strata,
1616
biomarker_names_var =

R/expect_snapshot_data.R

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#' Snapshot testing for [data.frame]s
2+
#' @description
3+
#' copied from <https://github.com/bcgov/ssdtools>
4+
#' with permission (<https://github.com/bcgov/ssdtools/issues/379>)
5+
#'
6+
#' @param x a [data.frame] to snapshot
7+
#' @param name [character] snapshot name
8+
#' @param digits [integer] passed to [signif()] for numeric variables
9+
#'
10+
#' @returns [NULL] (from [testthat::expect_snapshot_file()])
11+
#' @export
12+
#' @keywords internal
13+
#' @examples
14+
#' \dontrun{
15+
#' expect_snapshot_data(iris, name = "iris")
16+
#' }
17+
expect_snapshot_data <- function(x, name, digits = 6) {
18+
fun <- function(x) signif(x, digits = digits)
19+
lapply_fun <- function(x) I(lapply(x, fun))
20+
x <- dplyr::mutate(x, dplyr::across(tidyselect::where(is.numeric), fun))
21+
x <- dplyr::mutate(x, dplyr::across(tidyselect::where(is.list), lapply_fun))
22+
path <- save_csv(x)
23+
testthat::expect_snapshot_file(
24+
path,
25+
paste0(name, ".csv"),
26+
compare = testthat::compare_file_text
27+
)
28+
}
29+
30+
31+
save_csv <- function(x) {
32+
path <- tempfile(fileext = ".csv")
33+
readr::write_csv(x, path)
34+
path
35+
}

R/sim_pop_data.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#' * `"long"` (one measurement per row) or
3030
#' * `"wide"` (one serum sample per row)
3131
#' @inheritDotParams simcs.tinf
32+
#' @inheritDotParams ldpar
33+
#' @inheritDotParams ab
34+
#' @inheritDotParams mk_baseline
3235
#' @inheritParams log_likelihood # verbose
3336
#' @return a [tibble::tbl_df] containing simulated cross-sectional serosurvey
3437
#' data, with columns:

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ on [GitHub](https://github.com/UCD-SERG/serocalculator/issues).
141141

142142
Another great resource is **The Epidemiologist R Handbook**,
143143
which includes an introductory page on asking for help with R packages via GitHub:
144-
https://epirhandbook.com/en/getting-help.html
144+
https://epirhandbook.com/en/new_pages/help.html
145145

146146
## Contributing to this project
147147

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ reproducible example](https://reprex.tidyverse.org/) on
155155

156156
Another great resource is **The Epidemiologist R Handbook**, which
157157
includes an introductory page on asking for help with R packages via
158-
GitHub: <https://epirhandbook.com/en/getting-help.html>
158+
GitHub: <https://epirhandbook.com/en/new_pages/help.html>
159159

160160
## Contributing to this project
161161

_quarto.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
project:
2-
render: ['*.qmd']
2+
render:
3+
- "*.qmd" # Render all Quarto markdown files
4+
- "!data-raw/" # Exclude anything in the data-raw directory
35
author: "UC Davis Seroepidemiology Research Group (UCD-SERG)"
46
date: '`r Sys.Date()`'
57
format:

0 commit comments

Comments
 (0)