Skip to content

Commit 48489b1

Browse files
committed
chore: change name to better reflect use of variable
1 parent ce8df21 commit 48489b1

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

R/tm_outliers.R

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
662662
qenv <- teal.code::eval_code(
663663
qenv,
664664
substitute(
665-
expr = summary_table_pre <- ANL_OUTLIER %>%
665+
expr = summary_data_pre <- ANL_OUTLIER %>%
666666
dplyr::filter(is_outlier_selected) %>%
667667
dplyr::select(outlier_var_name, categorical_var_name) %>%
668668
dplyr::group_by(categorical_var_name) %>%
@@ -707,9 +707,9 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
707707
qenv <- teal.code::eval_code(
708708
qenv,
709709
quote(
710-
summary_table_pre <- summary_table_pre %>%
710+
summary_data_pre <- summary_data_pre %>%
711711
dplyr::arrange(desc(n_outliers / total_in_cat)) %>%
712-
dplyr::mutate(order = seq_len(nrow(summary_table_pre)))
712+
dplyr::mutate(order = seq_len(nrow(summary_data_pre)))
713713
)
714714
)
715715
}
@@ -723,17 +723,17 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
723723
# In this case, the column used for reordering is `order`.
724724
ANL_OUTLIER <- dplyr::left_join(
725725
ANL_OUTLIER,
726-
summary_table_pre[, c("order", categorical_var)],
726+
summary_data_pre[, c("order", categorical_var)],
727727
by = categorical_var
728728
)
729729
# so that x axis of plot aligns with columns of summary table, from most outliers to least by percentage
730730
ANL <- ANL %>%
731731
dplyr::left_join(
732-
dplyr::select(summary_table_pre, categorical_var_name, order),
732+
dplyr::select(summary_data_pre, categorical_var_name, order),
733733
by = categorical_var
734734
) %>%
735735
dplyr::arrange(order)
736-
summary_table <- summary_table_pre %>%
736+
summary_data <- summary_data_pre %>%
737737
dplyr::select(
738738
categorical_var_name,
739739
Outliers = display_str, Missings = display_str_na, Total = total_in_cat
@@ -750,11 +750,11 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
750750
)
751751
)
752752
} else {
753-
within(qenv, summary_table <- data.frame())
753+
within(qenv, summary_data <- data.frame())
754754
}
755755

756756
# Generate decoratable object from data
757-
qenv <- within(qenv, table <- rtables::df_to_tt(summary_table))
757+
qenv <- within(qenv, table <- rtables::df_to_tt(summary_data))
758758

759759
if (length(categorical_var) > 0 && nrow(qenv[["ANL_OUTLIER"]]) > 0) {
760760
shinyjs::show("order_by_outlier")
@@ -1072,7 +1072,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
10721072
if (iv_r()$is_valid()) {
10731073
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
10741074
if (!is.null(categorical_var)) {
1075-
decorated_final_q()[["summary_table"]]
1075+
decorated_final_q()[["summary_data"]]
10761076
}
10771077
}
10781078
},
@@ -1352,9 +1352,8 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
13521352
)
13531353
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
13541354
if (length(categorical_var) > 0) {
1355-
summary_table <- decorated_final_q()[["table"]]
13561355
card$append_text("Summary Table", "header3")
1357-
card$append_table(summary_table)
1356+
card$append_table(decorated_final_q()[["table"]])
13581357
}
13591358
card$append_text("Plot", "header3")
13601359
if (tab_type == "Boxplot") {

0 commit comments

Comments
 (0)