Skip to content

Commit

Permalink
Dead code and small test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mstackhouse committed Jan 26, 2024
1 parent ce21427 commit 4d39052
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 0 additions & 8 deletions R/nested.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ process_nested_count_target <- function(x) {
assert_that(quo_is_symbol(target_var[[2]]),
msg = "Inner layers must be data driven variables")

# if(quo_is_symbol(target_var[[1]])){
# first_var_length <- length(unique(target[[as_name(target_var[[1]])]]))
# second_var_length <- length(unique(target[[as_name(target_var[[2]])]]))
#
# assert_that(second_var_length >= first_var_length,
# msg = "The number of values of your second variable must be greater than the number of levels in your first variable")
# }

if(is.factor(target[[as_name(target_var[[1]])]])) {
warning(paste0("Factors are not currently supported in nested count layers",
" that have two data driven variables. Factors will be coerced into character vectors"),
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-count.R
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,9 @@ test_that("nested count layers error out when you try to add a total row", {
)

expect_snapshot_error(build(tab))

# The weird use of mtcars2 makes us have to overwrite this again
mtcars <- mtcars2
})

test_that("Tables with pop_data can accept a layer level where", {
Expand Down

0 comments on commit 4d39052

Please sign in to comment.