Skip to content

Commit 2bc2641

Browse files
llrs-rochegithub-actions[bot]m7praverissimo
authored
Replace table by plot on tm_missing_data (#922)
# Pull Request <!--- Replace `#nnn` with your issue link for reference. --> Fixes #495 Replaces the table by a plot on "By Variables Levels" tab. The colors match those in the other plots of the module. It also required to add a "new" dependency, formatters, which is a dependency of tern, rlistings, rtable. I added it on Suggests. There is an extra commit to update the lintr names ```r data <- within(teal_data(), { ADSL <- rADSL ADRS <- rADRS }) join_keys(data) <- default_cdisc_join_keys[names(data)] init( data = data, modules = modules(tm_missing_data()) ) |> runApp() ``` --------- Signed-off-by: Lluís Revilla <185338939+llrs-roche@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
1 parent 8a94c04 commit 2bc2641

16 files changed

+249
-146
lines changed

.lintr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ linters: linters_with_defaults(
22
line_length_linter = line_length_linter(120),
33
object_usage_linter = NULL,
44
object_name_linter = object_name_linter(styles = c("snake_case", "symbols"), regexes = c(ANL = "^ANL_?[0-9A-Z_]*$", ADaM = "^r?AD[A-Z]{2,3}_?[0-9]*$")),
5-
indentation_linter = NULL
5+
indentation_linter = NULL,
6+
pipe_consistency_linter = NULL
67
)

R/tm_a_pca.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
435435
teal.reporter::teal_card(obj),
436436
teal.reporter::teal_card("## Module's output(s)")
437437
)
438-
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes
438+
teal.code::eval_code(obj, "library(ggplot2);library(dplyr);library(tidyr)")
439439
})
440440
anl_merged_q <- reactive({
441441
req(anl_merged_input())

R/tm_a_regression.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ srv_a_regression <- function(id,
461461
teal.reporter::teal_card(obj),
462462
teal.reporter::teal_card("## Module's output(s)")
463463
)
464-
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr")') # nolint: quotes
464+
teal.code::eval_code(obj, "library(ggplot2);library(dplyr)")
465465
})
466466

467467
anl_merged_q <- reactive({

R/tm_data_table.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ srv_data_table <- function(id,
309309
teal::validate_has_data(df, min_nrow = 1L, msg = paste("data", dataname, "is empty"))
310310
qenv <- teal.code::eval_code(
311311
data(),
312-
'library("dplyr");library("DT")' # nolint: quotes.
312+
"library(dplyr);library(DT)"
313313
)
314314
teal.code::eval_code(
315315
qenv,

R/tm_g_association.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ tm_g_association <- function(label = "Association",
151151
show_association = TRUE,
152152
plot_height = c(600, 400, 5000),
153153
plot_width = NULL,
154-
distribution_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint: line_length.
155-
association_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint: line_length.
154+
distribution_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint line_length_linter.
155+
association_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint line_length_linter.
156156
pre_output = NULL,
157157
post_output = NULL,
158158
ggplot2_args = teal.widgets::ggplot2_args(),
@@ -345,7 +345,7 @@ srv_tm_g_association <- function(id,
345345
teal.reporter::teal_card(obj),
346346
teal.reporter::teal_card("## Module's output(s)")
347347
)
348-
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr")') # nolint: quotes
348+
teal.code::eval_code(obj, "library(ggplot2);library(dplyr)")
349349
})
350350
anl_merged_q <- reactive({
351351
req(anl_merged_input())

R/tm_g_bivariate.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,9 @@ srv_g_bivariate <- function(id,
558558
teal.reporter::teal_card(obj),
559559
teal.reporter::teal_card("## Module's output(s)")
560560
)
561-
obj %>%
562-
teal.code::eval_code('library("ggplot2");library("dplyr")') %>%
563-
teal.code::eval_code(as.expression(anl_merged_input()$expr)) # don't mix char with expr in single eval_code
561+
obj |>
562+
teal.code::eval_code("library(ggplot2);library(dplyr)") |>
563+
teal.code::eval_code(as.expression(anl_merged_input()$expr))
564564
})
565565

566566
merged <- list(

R/tm_g_distribution.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ srv_distribution <- function(id,
523523
)
524524

525525
qenv <- reactive(
526-
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
526+
teal.code::eval_code(data(), "library(ggplot2);library(dplyr)")
527527
)
528528

529529
anl_merged_q <- reactive({
@@ -663,7 +663,7 @@ srv_distribution <- function(id,
663663
"Group by variable must be `factor`, `character`, or `integer`"
664664
)
665665
)
666-
qenv <- teal.code::eval_code(qenv, 'library("forcats")') # nolint quotes
666+
qenv <- teal.code::eval_code(qenv, "library(forcats)")
667667
qenv <- teal.code::eval_code(
668668
qenv,
669669
substitute(
@@ -681,7 +681,7 @@ srv_distribution <- function(id,
681681
)
682682
)
683683

684-
qenv <- teal.code::eval_code(qenv, 'library("forcats")') # nolint quotes
684+
qenv <- teal.code::eval_code(qenv, "library(forcats)")
685685
qenv <- teal.code::eval_code(
686686
qenv,
687687
substitute(
@@ -891,7 +891,7 @@ srv_distribution <- function(id,
891891
}
892892

893893
if (length(t_dist) != 0 && main_type_var == "Density" && length(g_var) == 0 && length(s_var) == 0) {
894-
qenv <- teal.code::eval_code(qenv, 'library("ggpp")') # nolint quotes
894+
qenv <- teal.code::eval_code(qenv, "library(ggpp)")
895895
qenv <- teal.code::eval_code(
896896
qenv,
897897
substitute(
@@ -1037,7 +1037,7 @@ srv_distribution <- function(id,
10371037
)
10381038

10391039
if (length(t_dist) != 0 && length(g_var) == 0 && length(s_var) == 0) {
1040-
qenv <- teal.code::eval_code(qenv, 'library("ggpp")') # nolint quotes
1040+
qenv <- teal.code::eval_code(qenv, "library(ggpp)")
10411041
qenv <- teal.code::eval_code(
10421042
qenv,
10431043
substitute(
@@ -1233,7 +1233,7 @@ srv_distribution <- function(id,
12331233
qenv <- common_q()
12341234

12351235
if (length(s_var) == 0 && length(g_var) == 0) {
1236-
qenv <- teal.code::eval_code(qenv, 'library("generics")') # nolint quotes
1236+
qenv <- teal.code::eval_code(qenv, "library(generics)")
12371237
qenv <- teal.code::eval_code(
12381238
qenv,
12391239
substitute(
@@ -1247,7 +1247,7 @@ srv_distribution <- function(id,
12471247
)
12481248
)
12491249
} else {
1250-
qenv <- teal.code::eval_code(qenv, 'library("tidyr")') # nolint quotes
1250+
qenv <- teal.code::eval_code(qenv, "library(tidyr)")
12511251
qenv <- teal.code::eval_code(
12521252
qenv,
12531253
substitute(

R/tm_g_response.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ srv_g_response <- function(id,
387387
)
388388

389389
qenv <- reactive(
390-
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
390+
teal.code::eval_code(data(), "library(ggplot2);library(dplyr)")
391391
)
392392

393393
anl_merged_q <- reactive({
@@ -520,7 +520,7 @@ srv_g_response <- function(id,
520520
resp_cl = resp_cl,
521521
hjust_value = if (swap_axes) "left" else "middle",
522522
vjust_value = if (swap_axes) "middle" else -1,
523-
position_anl2_value = if (!freq) quote(position_fill(0.5)) else quote(position_stack(0.5)), # nolint: line_length.
523+
position_anl2_value = if (!freq) quote(position_fill(0.5)) else quote(position_stack(0.5)), # nolint: line_length_linter.
524524
anl3_y = if (!freq) 1.1 else as.name("ns"),
525525
position_anl3_value = if (!freq) "fill" else "stack"
526526
)

R/tm_g_scatterplot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ srv_g_scatterplot <- function(id,
587587
teal.reporter::teal_card(obj),
588588
teal.reporter::teal_card("## Module's output(s)")
589589
)
590-
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
590+
teal.code::eval_code(data(), "library(ggplot2);library(dplyr)")
591591
})
592592

593593
anl_merged_q <- reactive({

R/tm_g_scatterplotmatrix.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ srv_g_scatterplotmatrix <- function(id,
330330
teal.reporter::teal_card(obj),
331331
teal.reporter::teal_card("## Module's output(s)")
332332
)
333-
qenv <- teal.code::eval_code(obj, 'library("dplyr");library("lattice")') # nolint quotes
333+
qenv <- teal.code::eval_code(obj, "library(dplyr);library(lattice)")
334334
teal.code::eval_code(qenv, as.expression(anl_merged_input()$expr))
335335
})
336336

0 commit comments

Comments
 (0)