Skip to content

Commit

Permalink
Reduce space
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed May 23, 2024
1 parent 6c4a196 commit a0f5c59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions R/tabyl.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 3 additions & 8 deletions tests/testthat/test-tabyl.R
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down

0 comments on commit a0f5c59

Please sign in to comment.