Skip to content

Commit

Permalink
Merge branch 'main' into auto-document
Browse files Browse the repository at this point in the history
  • Loading branch information
d-morrison authored Jul 10, 2024
2 parents 8ba2cff + 56f56a8 commit df463ca
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: serocalculator
Type: Package
Title: Estimating Infection Rates from Serological Data
Version: 1.1.0
Version: 1.1.0.9000
Authors@R: c(
person(given = "Peter", family = "Teunis", email = "[email protected]", role = c("aut", "cph"), comment = "Author of the method and original code."),
person(given = "Kristina", family = "Lai", email = "[email protected]", role = c("aut", "cre")),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# serocalculator (development version)

* Added `verbose` option for `check_pop_data()`, changing default behavior
to avoid printing an OK message.

# serocalculator 1.1.0

* Renamed `llik()` to `log_likelihood()`
Expand Down
7 changes: 4 additions & 3 deletions R/check_pop_data.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Check the formatting of a cross-sectional antibody survey dataset.
#'
#' @param pop_data dataset to check
#'
#' @param verbose whether to print an "OK" message when all checks pass
#' @returns NULL (invisibly)
#' @export
#' @examples
Expand All @@ -10,7 +10,8 @@
#' xs_data <- load_pop_data("https://osf.io/download//n6cp3/") %>%
#' check_pop_data()
#'
check_pop_data <- function(pop_data) {
check_pop_data <- function(pop_data,
verbose = FALSE) {
if (!is.data.frame(pop_data)) {
cli::cli_abort(message = .pasteN(
"Argument `pop_data` is not a `data.frame()`.",
Expand All @@ -30,6 +31,6 @@ check_pop_data <- function(pop_data) {
cli::cli_abort(message = paste("Argument `pop_data` is missing column", attributes(pop_data)$value_var, "(antibody measurement)"))
}

message("data format is as expected.")
if(verbose) message("data format is as expected.")
invisible(NULL)
}
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
url: https://ucd-serg.github.io/serocalculator/
template:
bootstrap: 5
light-switch: true

4 changes: 3 additions & 1 deletion man/check_pop_data.Rd

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

2 changes: 1 addition & 1 deletion vignettes/articles/enteric_fever_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ xs_data <-
We can check that `xs_data` has the correct formatting using the `check_pop_data()` function:

```{r, message = TRUE}
xs_data %>% check_pop_data()
xs_data %>% check_pop_data(verbose = TRUE)
```

#### Summarize antibody data
Expand Down
2 changes: 1 addition & 1 deletion vignettes/articles/scrubTyphus_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ xs_data <- load_pop_data(
We can check that `xs_data` has the correct formatting using the `check_pop_data()` function:

```{r, message = TRUE}
xs_data %>% check_pop_data()
xs_data %>% check_pop_data(verbose = TRUE)
```

#### Summarize antibody data
Expand Down

0 comments on commit df463ca

Please sign in to comment.