Skip to content

Commit fe3a48a

Browse files
committed
feat: fix missing data decorators
1 parent 5d570d6 commit fe3a48a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

R/tm_missing_data.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#' - `summary_plot` (`grob` created with [ggplot2::ggplotGrob()])
2424
#' - `combination_plot` (`grob` created with [ggplot2::ggplotGrob()])
2525
#' - `by_subject_plot` (`ggplot2`)
26-
#' - `table` ([DT::datatable()])
26+
#' - `table` (`listing_df` created with [rlistings::as_listing()])
2727
#'
2828
#' Decorators can be applied to all outputs or only to specific objects using a
2929
#' named list of `teal_transform_module` objects.
@@ -1392,7 +1392,12 @@ srv_missing_data <- function(id,
13921392
card$append_plot(combination_plot_r(), dim = pws2$dim())
13931393
} else if (sum_type == "By Variable Levels") {
13941394
card$append_text("Table", "header3")
1395-
card$append_table(decorated_summary_table_q()[["table"]])
1395+
table <- decorated_summary_table_q()[["table"]]
1396+
if (nrow(table) == 0L) {
1397+
card$append_text("No data available for table.")
1398+
} else {
1399+
card$append_table(table)
1400+
}
13961401
} else if (sum_type == "Grouped by Subject") {
13971402
card$append_text("Plot", "header3")
13981403
card$append_plot(by_subject_plot_r(), dim = pws3$dim())

man/tm_missing_data.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)