Skip to content

Commit

Permalink
Fix pkgdown; add another example
Browse files Browse the repository at this point in the history
  • Loading branch information
billdenney committed May 22, 2024
1 parent 7a8e651 commit 030a03d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
10 changes: 10 additions & 0 deletions R/assert_count_true.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
#' dplyr::mutate(
#' big_values = assert_count_true(A > 2, n = 3)
#' )
#'
#' my_data <- data.frame(name = c("Bill", "Sam"), birthdate = c("2024-05-22", "2024-05-22"))
#' my_data |>
#' dplyr::mutate(
#' birthdate =
#' dplyr::case_when(
#' assert_count_true(name == "Bill" & birthdate == "2024-05-22") ~ "2024-05-23",
#' TRUE ~ birthdate
#' )
#' )
#' @export
assert_count_true <- function(x, n = 1) {
stopifnot(is.logical(x))
Expand Down
11 changes: 6 additions & 5 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ template:

reference:
- title: Cleaning data

- subtitle: Cleaning variable names
contents:
- contains("clean_names")

- title: Exploring data
desc: >
tabyls are an enhanced version of tables. See `vignette("tabyls")`
Expand All @@ -19,7 +19,7 @@ reference:
- starts_with("adorn")
- contains("tabyl")
- -contains('.test')

- subtitle: Change order
contents:
- row_to_names
Expand All @@ -30,6 +30,7 @@ reference:
Compare data frames columns
contents:
- starts_with("compare_df_cols")
- assert_count_true

- title: Removing unnecessary columns / rows
contents:
Expand All @@ -38,9 +39,9 @@ reference:
- get_one_to_one
- top_levels
- single_value

- title: Rounding / dates helpers
desc: >
desc: >
Help to mimic some behaviour from Excel or SAS.
These should be used on vector.
contents:
Expand Down
10 changes: 10 additions & 0 deletions man/assert_count_true.Rd

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

0 comments on commit 030a03d

Please sign in to comment.