Skip to content

Commit

Permalink
Merge pull request #157 from atorus-research/gh_issue_134_150_v2
Browse files Browse the repository at this point in the history
Documentation updates and typo corrections
  • Loading branch information
mstackhouse committed Dec 14, 2023
2 parents 1bde2a5 + dcfaab0 commit 8dfda81
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: pkgdown
extra-packages: any::pkgdown, local::.
needs: website

- name: Deploy package
Expand Down
8 changes: 4 additions & 4 deletions R/apply_conditional_format.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
#' @noRd
validate_conditional_format_params <- function(string, format_group, condition, replacement, full_string) {
if (!inherits(string, "character")) {
stop("Paramter `string` must be a character vector", call.=FALSE)
stop("Parameter `string` must be a character vector", call.=FALSE)
}

if (!inherits(format_group, "numeric") || (inherits(format_group, "numeric") && format_group %% 1 != 0)) {
stop("Paramter `format_group` must be an integer", call.=FALSE)
stop("Parameter `format_group` must be an integer", call.=FALSE)
}

if (!inherits(replacement, "character")) {
stop("Paramter `replacement` must be a string", call.=FALSE)
stop("Parameter `replacement` must be a string", call.=FALSE)
}

# Condition statement must use the variable name 'x'
Expand All @@ -28,7 +28,7 @@ validate_conditional_format_params <- function(string, format_group, condition,
}

if (!inherits(full_string, "logical")) {
stop("Paramter `full_string` must be bool", call.=FALSE)
stop("Parameter `full_string` must be bool", call.=FALSE)
}

}
Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test-apply_conditional_format.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ test_string2 <- c(" 0 ( 0.0%)", " 8 ( 9.3%)", "78 (90.7%) [ 5]", "12", "Howdy ya
test_that("Test input validation and warning generation", {
expect_error(
apply_conditional_format(c(1), 2, x == 0, "(<1%)", full_string=TRUE),
"Paramter `string`"
"Parameter `string`"
)

expect_error(
apply_conditional_format(test_string1, "bad", x == 0, "(<1%)", full_string=TRUE),
"Paramter `format_group`"
"Parameter `format_group`"
)

expect_error(
apply_conditional_format(test_string1, 1.1, x == 0, "(<1%)", full_string=TRUE),
"Paramter `format_group`"
"Parameter `format_group`"
)

expect_error(
Expand All @@ -24,12 +24,12 @@ test_that("Test input validation and warning generation", {

expect_error(
apply_conditional_format(test_string1, 2, x == 0, 1, full_string=TRUE),
"Paramter `replacement"
"Parameter `replacement"
)

expect_error(
apply_conditional_format(test_string1, 2, x == 0, "(<1%)", full_string="TRUE"),
"Paramter `full_string`"
"Parameter `full_string`"
)

expect_warning(
Expand Down
2 changes: 2 additions & 0 deletions vignettes/table.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ header_n(t) %>%
kable()
```

Note: it’s expected the `set_distinct_by()` function is used with population data. This is because it does not make sense to use population data denominators unless you have distinct counts. The entire point of population data is to use subject counts, so non-distinct counts would potentially count multiple records per subject and then the percentage doesn’t make any sense.

With the table level settings under control, now you're ready to learn more about what **Tplyr** has to offer in each layer.

- Learn more about descriptive statistics layers in `vignette("desc")`
Expand Down

0 comments on commit 8dfda81

Please sign in to comment.