Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ayogasekaram committed Jul 3, 2024
1 parent 59ef379 commit 0adcf6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 9 additions & 6 deletions tests/testthat/_snaps/ard_categorical.survey.design.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@
ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived,
denominator = "row")
Condition
Error in `ard_categorical()`:
! Column "Class" is a factor with NA levels, which are not allowed.
Error in `FUN()`:
! Column "Class" is all missing and cannot be tabulated.
i Only columns of class <logical> and <factor> can be tabulated when all values are missing.

---

Code
ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived,
denominator = "column")
Condition
Error in `ard_categorical()`:
! Column "Class" is a factor with NA levels, which are not allowed.
Error in `FUN()`:
! Column "Class" is all missing and cannot be tabulated.
i Only columns of class <logical> and <factor> can be tabulated when all values are missing.

---

Code
ard_categorical(svy_titanic, variables = c(Class, Age), by = Survived,
denominator = "cell")
Condition
Error in `ard_categorical()`:
! Column "Class" is a factor with NA levels, which are not allowed.
Error in `FUN()`:
! Column "Class" is all missing and cannot be tabulated.
i Only columns of class <logical> and <factor> can be tabulated when all values are missing.

1 change: 0 additions & 1 deletion tests/testthat/test-ard_categorical.survey.design.R
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ test_that("ard_categorical.survey.design() returns an error when variables have

# row denom
svy_titanic$variables$Class <- NA
svy_titanic$variables$Class <- fct_na_value_to_level(svy_titanic$variables$Class)

expect_snapshot(
ard_categorical(
Expand Down

0 comments on commit 0adcf6e

Please sign in to comment.