Skip to content

Commit 4dc9826

Browse files
committed
chore: add titles to tables in report
1 parent c57953f commit 4dc9826

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

.pre-commit-config.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,45 @@ repos:
1818
- ggmosaic
1919
- ggplot2
2020
- shiny
21+
- insightsengineering/teal
22+
- insightsengineering/teal.transform
23+
- bslib
2124
- checkmate
25+
- colourpicker
2226
- dplyr
2327
- DT
2428
- forcats
29+
- ggExtra
30+
- ggpmisc
31+
- ggpp
32+
- ggrepel
33+
- goftest
2534
- grid
26-
- logger
35+
- gridExtra
36+
- htmlwidgets
37+
- jsonlite
38+
- lattice
39+
- lifecycle
40+
- MASS
41+
- rtables
2742
- scales
2843
- shinyjs
2944
- shinyTree
3045
- shinyvalidate
3146
- shinyWidgets
47+
- sparkline
3248
- stats
3349
- stringr
34-
- insightsengineering/roxy.shinylive
35-
- insightsengineering/teal
36-
- insightsengineering/teal.transform
3750
- insightsengineering/teal.code
3851
- insightsengineering/teal.data
3952
- insightsengineering/teal.logger
4053
- insightsengineering/teal.reporter
41-
- insightsengineering/teal.slice
4254
- insightsengineering/teal.widgets
4355
- tern
4456
- tibble
4557
- tidyr
46-
- utils
47-
58+
- insightsengineering/teal.slice
59+
- insightsengineering/roxy.shinylive
4860
- id: spell-check
4961
name: Check spelling with `spelling`
5062
exclude: >

R/tm_g_distribution.R

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,15 +1273,19 @@ srv_distribution <- function(id,
12731273
output_qq_q <- reactive(c(common_q(), req(qq_q())))
12741274

12751275
# Summary table listing has to be created separately to allow for qenv join
1276+
q_common <- common_q()
1277+
teal.reporter::teal_card(q_common) <- c(
1278+
teal.reporter::teal_card(q_common),
1279+
"## Statistics table"
1280+
)
12761281
output_summary_q <- reactive({
12771282
if (iv_r()$is_valid()) {
1278-
within(common_q(), {
1283+
within(q_common, {
12791284
summary_table <- rtables::df_to_tt(summary_table_data)
1280-
summary_table
12811285
})
12821286
} else {
12831287
within(
1284-
common_q(),
1288+
q_common,
12851289
summary_table <- rtables::rtable(header = rtables::rheader(colnames(summary_table_data)))
12861290
)
12871291
}
@@ -1290,15 +1294,19 @@ srv_distribution <- function(id,
12901294
output_test_q <- reactive({
12911295
# wrapped in if since could lead into validate error - we do want to continue
12921296
test_q_out <- try(test_q(), silent = TRUE)
1297+
q_common <- common_q()
1298+
teal.reporter::teal_card(q_common) <- c(
1299+
teal.reporter::teal_card(q_common),
1300+
"## Distribution Tests table"
1301+
)
12931302
if (inherits(test_q_out, c("try-error", "error"))) {
12941303
within(
1295-
common_q(),
1304+
q_common,
12961305
test_table <- rtables::rtable(header = rtables::rheader("No data available in table"), rtables::rrow())
12971306
)
12981307
} else {
1299-
within(c(common_q(), test_q_out), {
1308+
within(c(q_common, test_q_out), {
13001309
test_table <- rtables::df_to_tt(test_table_data)
1301-
test_table
13021310
})
13031311
}
13041312
})

0 commit comments

Comments
 (0)