Skip to content

Commit

Permalink
Merge pull request #114 from NIFU-NO/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
sda030 authored Aug 24, 2024
2 parents 8ca6aa0 + fdf6271 commit dc38761
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Suggests:
tibble,
withr,
quarto,
spelling
spelling,
vdiffr
Config/testthat/edition: 3
Encoding: UTF-8
RoxygenNote: 7.3.2
Expand Down
4 changes: 3 additions & 1 deletion R/summarize_cat_cat_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Helper function to create overarching factor variable for the response categories column
category_var_as_fct <-
function(data_summary, fct_unions) {

data_summary$.category <- factor(x = data_summary$.category,
levels = fct_unions,
labels = fct_unions)
labels = fct_unions,
exclude = NULL)
data_summary
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions tests/testthat/test-make_content.cat_plot_html.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
testthat::test_that("show.legend works with unused categories", {
vdiffr::expect_doppelganger(title = "Unused categories in legend",
fig = {
saros.contents::ex_survey |>
dplyr::filter(dplyr::if_all(p_1:p_4, ~.x != "Strongly agree")) |>
saros.contents::makeme(dep=p_1:p_4, indep=x1_sex)
})
})

0 comments on commit dc38761

Please sign in to comment.