Skip to content

Commit 52b4d59

Browse files
committed
substitute append.teal_card with c.teal_card
1 parent 45b9080 commit 52b4d59

File tree

10 files changed

+79
-49
lines changed

10 files changed

+79
-49
lines changed

R/tm_a_pca.R

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -435,15 +435,12 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
435435
)
436436
qenv <- reactive({
437437
obj <- data()
438-
teal.reporter::teal_card(obj) <- append(
439-
teal.reporter::teal_card(obj),
440-
"# Principal Component Analysis",
441-
after = 0
442-
)
443-
teal.reporter::teal_card(obj) <- c(
444-
teal.reporter::teal_card(obj),
445-
"## Module's code"
446-
)
438+
teal.reporter::teal_card(obj) <-
439+
c(
440+
teal.reporter::teal_card("# Principal Component Analysis"),
441+
teal.reporter::teal_card(obj),
442+
teal.reporter::teal_card("## Module's code")
443+
)
447444
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("tidyr")') # nolint: quotes.
448445
})
449446
anl_merged_q <- reactive({
@@ -521,7 +518,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
521518
)
522519
)
523520

524-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Principal Components Table")
521+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Principal Components Table")
525522

526523
qenv <- teal.code::eval_code(
527524
qenv,
@@ -531,7 +528,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
531528
})
532529
)
533530

534-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Eigenvectors Table")
531+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Eigenvectors Table")
535532

536533
teal.code::eval_code(
537534
qenv,
@@ -613,7 +610,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
613610
),
614611
ggtheme = ggtheme
615612
)
616-
teal.reporter::teal_card(base_q) <- append(teal.reporter::teal_card(base_q), "## Elbow plot")
613+
teal.reporter::teal_card(base_q) <- c(teal.reporter::teal_card(base_q), "## Elbow plot")
617614
teal.code::eval_code(
618615
base_q,
619616
substitute(
@@ -690,7 +687,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
690687
ggtheme = ggtheme
691688
)
692689

693-
teal.reporter::teal_card(base_q) <- append(teal.reporter::teal_card(base_q), "## Circle plot")
690+
teal.reporter::teal_card(base_q) <- c(teal.reporter::teal_card(base_q), "## Circle plot")
694691
teal.code::eval_code(
695692
base_q,
696693
substitute(
@@ -749,7 +746,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
749746
size <- input$size
750747
font_size <- input$font_size
751748

752-
teal.reporter::teal_card(base_q) <- append(teal.reporter::teal_card(base_q), "## Biplot")
749+
teal.reporter::teal_card(base_q) <- c(teal.reporter::teal_card(base_q), "## Biplot")
753750
qenv <- teal.code::eval_code(
754751
qenv,
755752
substitute(
@@ -1010,7 +1007,7 @@ srv_a_pca <- function(id, data, dat, plot_height, plot_width, ggplot2_args, deco
10101007
parsed_ggplot2_args$theme
10111008
)
10121009

1013-
teal.reporter::teal_card(base_q) <- append(teal.reporter::teal_card(base_q), "## Eigenvector plot")
1010+
teal.reporter::teal_card(base_q) <- c(teal.reporter::teal_card(base_q), "## Eigenvector plot")
10141011
teal.code::eval_code(
10151012
base_q,
10161013
substitute(

R/tm_a_regression.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,12 @@ srv_a_regression <- function(id,
459459

460460
qenv <- reactive({
461461
obj <- data()
462-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Linear Regression Plot", after = 0)
463-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
462+
teal.reporter::teal_card(obj) <-
463+
c(
464+
teal.reporter::teal_card("# Linear Regression Plot"),
465+
teal.reporter::teal_card(obj),
466+
teal.reporter::teal_card("## Module's code")
467+
)
464468
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr")') # nolint quotes
465469
})
466470

@@ -538,7 +542,7 @@ srv_a_regression <- function(id,
538542
fit_summary <- summary(fit)
539543
fit_summary
540544
}))
541-
teal.reporter::teal_card(anl_fit) <- append(teal.reporter::teal_card(anl_fit), "## Plot")
545+
teal.reporter::teal_card(anl_fit) <- c(teal.reporter::teal_card(anl_fit), "## Plot")
542546
anl_fit
543547
})
544548

R/tm_g_association.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,12 @@ srv_tm_g_association <- function(id,
343343

344344
qenv <- reactive({
345345
obj <- data()
346-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Association Plot", after = 0)
347-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
346+
teal.reporter::teal_card(obj) <-
347+
c(
348+
teal.reporter::teal_card("# Association Plot"),
349+
teal.reporter::teal_card(obj),
350+
teal.reporter::teal_card("## Module's code")
351+
)
348352
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr");library("ggmosaic")') # nolint quotes
349353
})
350354
anl_merged_q <- reactive({
@@ -494,7 +498,7 @@ srv_tm_g_association <- function(id,
494498
)
495499
}
496500
obj <- merged$anl_q_r()
497-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "## Plot")
501+
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Plot")
498502
teal.code::eval_code(
499503
obj,
500504
substitute(

R/tm_g_bivariate.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,12 @@ srv_g_bivariate <- function(id,
556556

557557
anl_merged_q <- reactive({
558558
obj <- data()
559-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Bivariate Plot", after = 0)
560-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
559+
teal.reporter::teal_card(obj) <-
560+
c(
561+
teal.reporter::teal_card("# Bivariate Plot"),
562+
teal.reporter::teal_card(obj),
563+
teal.reporter::teal_card("## Module's code")
564+
)
561565
obj %>%
562566
teal.code::eval_code(
563567
c(
@@ -691,7 +695,7 @@ srv_g_bivariate <- function(id,
691695
}
692696

693697
obj <- merged$anl_q_r()
694-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "## Plot")
698+
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Plot")
695699
teal.code::eval_code(obj, substitute(expr = plot <- cl, env = list(cl = cl)))
696700
})
697701

R/tm_g_distribution.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,12 @@ srv_distribution <- function(id,
636636
# Create a private stack for this function only.
637637

638638
obj <- merged$anl_q_r()
639-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Distribution Plot", after = 0)
640-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
639+
teal.reporter::teal_card(obj) <-
640+
c(
641+
teal.reporter::teal_card("# Distribution Plot"),
642+
teal.reporter::teal_card(obj),
643+
teal.reporter::teal_card("## Module's code")
644+
)
641645

642646
ANL <- obj[["ANL"]]
643647
dist_var <- merge_vars()$dist_var
@@ -953,7 +957,7 @@ srv_distribution <- function(id,
953957
ggtheme = ggtheme
954958
)
955959

956-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Histogram Plot")
960+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Histogram Plot")
957961
teal.code::eval_code(
958962
qenv,
959963
substitute(
@@ -1084,7 +1088,7 @@ srv_distribution <- function(id,
10841088
ggtheme = ggtheme
10851089
)
10861090

1087-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## QQ Plot")
1091+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## QQ Plot")
10881092
teal.code::eval_code(
10891093
qenv,
10901094
substitute(

R/tm_g_response.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,12 @@ srv_g_response <- function(id,
408408
teal::validate_inputs(iv_r())
409409

410410
qenv <- merged$anl_q_r()
411-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "# Response Plot", after = 0)
412-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
411+
teal.reporter::teal_card(qenv) <-
412+
c(
413+
teal.reporter::teal_card("# Response Plot"),
414+
teal.reporter::teal_card(qenv),
415+
teal.reporter::teal_card("## Module's code")
416+
)
413417
ANL <- qenv[["ANL"]]
414418
resp_var <- as.vector(merged$anl_input_r()$columns_source$response)
415419
x <- as.vector(merged$anl_input_r()$columns_source$x)
@@ -569,7 +573,7 @@ srv_g_response <- function(id,
569573
ggthemes = parsed_ggplot2_args$ggtheme
570574
))
571575

572-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Plot")
576+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Plot")
573577
teal.code::eval_code(qenv, plot_call)
574578
})
575579

R/tm_g_scatterplot.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,11 @@ srv_g_scatterplot <- function(id,
586586
)
587587
qenv <- reactive({
588588
obj <- data()
589-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Scatter Plot", after = 0)
590-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
589+
teal.reporter::teal_card(obj) <- c(
590+
teal.reporter::teal_card("# Scatter Plot"),
591+
teal.reporter::teal_card(obj),
592+
teal.reporter::teal_card("## Module's code")
593+
)
591594
teal.code::eval_code(obj, 'library("ggplot2");library("dplyr")') # nolint quotes
592595
})
593596

@@ -1013,7 +1016,7 @@ srv_g_scatterplot <- function(id,
10131016

10141017
plot_call <- substitute(expr = plot <- plot_call, env = list(plot_call = plot_call))
10151018

1016-
teal.reporter::teal_card(plot_q) <- append(teal.reporter::teal_card(plot_q), "## Plot")
1019+
teal.reporter::teal_card(plot_q) <- c(teal.reporter::teal_card(plot_q), "## Plot")
10171020
teal.code::eval_code(plot_q, plot_call)
10181021
})
10191022

R/tm_g_scatterplotmatrix.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,11 @@ srv_g_scatterplotmatrix <- function(id,
329329
anl_merged_q <- reactive({
330330
req(anl_merged_input())
331331
obj <- data()
332-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Scatter Plot Matrix", after = 0)
333-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
332+
teal.reporter::teal_card(obj) <- c(
333+
teal.reporter::teal_card("# Scatter Plot Matrix"),
334+
teal.reporter::teal_card(obj),
335+
teal.reporter::teal_card("## Module's code")
336+
)
334337
qenv <- teal.code::eval_code(obj, 'library("dplyr");library("lattice")') # nolint: quotes.
335338
teal.code::eval_code(qenv, as.expression(anl_merged_input()$expr))
336339
})
@@ -392,7 +395,7 @@ srv_g_scatterplotmatrix <- function(id,
392395

393396

394397
# create plot
395-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Plot")
398+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Plot")
396399

397400
if (add_cor) {
398401
shinyjs::show("cor_method")

R/tm_missing_data.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,11 @@ srv_missing_data <- function(id,
527527
group_var <- input$group_by_var
528528
anl <- data_r()
529529
obj <- data()
530-
teal.reporter::teal_card(obj) <- append(teal.reporter::teal_card(obj), "# Missing Data", after = 0)
531-
teal.reporter::teal_card(obj) <- c(teal.reporter::teal_card(obj), "## Module's code")
530+
teal.reporter::teal_card(obj) <- c(
531+
teal.reporter::teal_card("# Missing Data"),
532+
teal.reporter::teal_card(obj),
533+
teal.reporter::teal_card("## Module's code")
534+
)
532535

533536
qenv <- teal.code::eval_code(obj, {
534537
'library("dplyr");library("ggplot2");library("tidyr");library("gridExtra")' # nolint quotes
@@ -697,7 +700,7 @@ srv_missing_data <- function(id,
697700
combination_cutoff_q <- reactive({
698701
req(common_code_q())
699702
qenv <- common_code_q()
700-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Combination Plot")
703+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Combination Plot")
701704
teal.code::eval_code(
702705
qenv,
703706
quote(
@@ -756,7 +759,7 @@ srv_missing_data <- function(id,
756759
)
757760
)
758761

759-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Summary Plot")
762+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Summary Plot")
760763

761764
qenv <- teal.code::eval_code(
762765
qenv,
@@ -1112,7 +1115,7 @@ srv_missing_data <- function(id,
11121115
}
11131116

11141117
qenv <- common_code_q()
1115-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Summary Table")
1118+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Summary Table")
11161119

11171120
qenv <- if (!is.null(group_var)) {
11181121
common_code_libraries_q <- teal.code::eval_code(
@@ -1190,7 +1193,7 @@ srv_missing_data <- function(id,
11901193
}
11911194

11921195
qenv <- common_code_q()
1193-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## By Subject Plot")
1196+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## By Subject Plot")
11941197

11951198
qenv <- teal.code::eval_code(
11961199
qenv,

R/tm_outliers.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,12 @@ srv_outliers <- function(id, data, outlier_var,
473473

474474
ANL <- merged$anl_q_r()[["ANL"]]
475475
qenv <- merged$anl_q_r()
476-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "# Outliers Analysis", after = 0)
477-
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Module's code")
476+
teal.reporter::teal_card(qenv) <-
477+
c(
478+
teal.reporter::teal_card("# Outliers Analysis"),
479+
teal.reporter::teal_card(qenv),
480+
teal.reporter::teal_card("## Module's code")
481+
)
478482

479483
outlier_var <- as.vector(merged$anl_input_r()$columns_source$outlier_var)
480484
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
@@ -636,7 +640,7 @@ srv_outliers <- function(id, data, outlier_var,
636640
)
637641

638642
qenv <- if (length(categorical_var) > 0) {
639-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Summary Table")
643+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Summary Table")
640644
qenv <- teal.code::eval_code(
641645
qenv,
642646
substitute(
@@ -749,7 +753,7 @@ srv_outliers <- function(id, data, outlier_var,
749753
box_plot_q <- reactive({
750754
req(common_code_q())
751755
qenv <- common_code_q()
752-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Box Plot")
756+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Box Plot")
753757

754758
ANL <- qenv[["ANL"]]
755759
ANL_OUTLIER <- qenv[["ANL_OUTLIER"]]
@@ -843,7 +847,7 @@ srv_outliers <- function(id, data, outlier_var,
843847
# density plot
844848
density_plot_q <- reactive({
845849
qenv <- common_code_q()
846-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Density Plot")
850+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Density Plot")
847851

848852
ANL <- qenv[["ANL"]]
849853
ANL_OUTLIER <- qenv[["ANL_OUTLIER"]]
@@ -905,7 +909,7 @@ srv_outliers <- function(id, data, outlier_var,
905909
# Cumulative distribution plot
906910
cumulative_plot_q <- reactive({
907911
qenv <- common_code_q()
908-
teal.reporter::teal_card(qenv) <- append(teal.reporter::teal_card(qenv), "## Cumulative Distribution Plot")
912+
teal.reporter::teal_card(qenv) <- c(teal.reporter::teal_card(qenv), "## Cumulative Distribution Plot")
909913

910914
ANL <- qenv[["ANL"]]
911915
ANL_OUTLIER <- qenv[["ANL_OUTLIER"]]

0 commit comments

Comments
 (0)