From 4d39052e2f1289ec2f03668048ab1bde6da050a1 Mon Sep 17 00:00:00 2001 From: "mike.stackhouse" Date: Fri, 26 Jan 2024 19:57:41 +0000 Subject: [PATCH] Dead code and small test fix --- R/nested.R | 8 -------- tests/testthat/test-count.R | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/R/nested.R b/R/nested.R index a6c8fcdd..e05e854c 100644 --- a/R/nested.R +++ b/R/nested.R @@ -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"), diff --git a/tests/testthat/test-count.R b/tests/testthat/test-count.R index 9c84dd4d..b4d929f2 100644 --- a/tests/testthat/test-count.R +++ b/tests/testthat/test-count.R @@ -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", {