diff --git a/R/tabyl.R b/R/tabyl.R index 4cc6214..599e6f1 100644 --- a/R/tabyl.R +++ b/R/tabyl.R @@ -175,10 +175,6 @@ tabyl.data.frame <- function(dat, var1, var2, var3, show_na = TRUE, show_missing } } -get_label <- function(x) { - attr(x, "label", exact = TRUE) -} - # a one-way frequency table; this was called "tabyl" in janitor <= 0.3.0 tabyl_1way <- function(dat, var1, show_na = TRUE, show_missing_levels = TRUE) { x <- dplyr::select(dat, !!var1) diff --git a/tests/testthat/test-tabyl.R b/tests/testthat/test-tabyl.R index 6cfe9ca..9e71943 100644 --- a/tests/testthat/test-tabyl.R +++ b/tests/testthat/test-tabyl.R @@ -399,15 +399,10 @@ test_that("tabyl works with label attributes (#394)", { mt_label <- mtcars attr(mt_label$cyl, "label") <- "Number of cyl" tab <- tabyl(mt_label, cyl) - expect_named( - tab, - c("Number of cyl", "n", "percent") - ) + expect_named(tab, c("Number of cyl", "n", "percent")) + tab2 <- tabyl(mt_label, cyl, am) - expect_named( - tab2, - c("Number of cyl", "0", "1") - ) + expect_named(tab2, c("Number of cyl", "0", "1")) }) test_that("tabyl works with ordered 1st variable, #386", {