From 9f8ea57e7f47f16db8bf38e7750168b06a457da4 Mon Sep 17 00:00:00 2001 From: Aleksander Chlebowski <114988527+chlebowa@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:03:07 +0100 Subject: [PATCH] fix nolint syntax (#638) https://github.com/insightsengineering/teal.modules.general/pull/636#issuecomment-1952150583 --- R/tm_a_pca.R | 10 +++---- R/tm_a_regression.R | 4 +-- R/tm_g_association.R | 6 ++-- R/tm_g_bivariate.R | 4 +-- R/tm_g_distribution.R | 10 +++---- R/tm_g_response.R | 6 ++-- R/tm_g_scatterplot.R | 12 ++++---- R/tm_g_scatterplotmatrix.R | 8 +++--- R/tm_missing_data.R | 8 +++--- R/tm_outliers.R | 59 +++++++++++++++++++------------------- R/tm_t_crosstable.R | 4 +-- R/tm_variable_browser.R | 4 +-- data-raw/data.R | 10 +++---- 13 files changed, 73 insertions(+), 72 deletions(-) diff --git a/R/tm_a_pca.R b/R/tm_a_pca.R index c1fda7608..74eb8ebb5 100644 --- a/R/tm_a_pca.R +++ b/R/tm_a_pca.R @@ -345,7 +345,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl standardization <- input$standardization center <- standardization %in% c("center", "center_scale") scale <- standardization == "center_scale" - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. teal::validate_has_data(ANL, 10) validate(need( @@ -376,7 +376,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl standardization <- input$standardization center <- standardization %in% c("center", "center_scale") scale <- standardization == "center_scale" - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. qenv <- teal.code::eval_code( merged$anl_q_r(), @@ -389,7 +389,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl if (na_action == "drop") { qenv <- teal.code::eval_code( qenv, - quote(ANL <- tidyr::drop_na(ANL, keep_columns)) # nolint object_name_linter + quote(ANL <- tidyr::drop_na(ANL, keep_columns)) # nolint: object_name. ) } @@ -611,7 +611,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl plot_biplot <- function(base_q) { qenv <- base_q - ANL <- qenv[["ANL"]] # nolint object_name_linter + ANL <- qenv[["ANL"]] # nolint: object_name. resp_col <- as.character(merged$anl_input_r()$columns_source$response) dat_cols <- as.character(merged$anl_input_r()$columns_source$dat) @@ -707,7 +707,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl dev_labs <- list(color = varname_w_label(resp_col, ANL)) scales_biplot <- - if (is.character(response) || is.factor(response) || (is.numeric(response) && length(unique(response)) <= 6)) { # nolint line_length_linter + if (is.character(response) || is.factor(response) || (is.numeric(response) && length(unique(response)) <= 6)) { # nolint: line_length. qenv <- teal.code::eval_code( qenv, quote(pca_rot$response <- as.factor(response)) diff --git a/R/tm_a_regression.R b/R/tm_a_regression.R index af146d997..d82a17639 100644 --- a/R/tm_a_regression.R +++ b/R/tm_a_regression.R @@ -312,7 +312,7 @@ srv_a_regression <- function(id, # sets qenv object and populates it with data merge call and fit expression fit_r <- reactive({ - ANL <- anl_merged_q()[["ANL"]] # nolint object_name_linter + ANL <- anl_merged_q()[["ANL"]] # nolint: object_name. teal::validate_has_data(ANL, 10) validate(need(is.numeric(ANL[regression_var()$response][[1]]), "Response variable should be numeric.")) @@ -409,7 +409,7 @@ srv_a_regression <- function(id, plot_type_0 <- function() { fit <- fit_r()[["fit"]] - ANL <- anl_merged_q()[["ANL"]] # nolint object_name_linter + ANL <- anl_merged_q()[["ANL"]] # nolint: object_name. stopifnot(ncol(fit$model) == 2) diff --git a/R/tm_g_association.R b/R/tm_g_association.R index da605728b..43b37062b 100644 --- a/R/tm_g_association.R +++ b/R/tm_g_association.R @@ -74,8 +74,8 @@ tm_g_association <- function(label = "Association", show_association = TRUE, plot_height = c(600, 400, 5000), plot_width = NULL, - distribution_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint line_length_linter - association_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint line_length_linter + distribution_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint: line_length. + association_theme = c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void"), # nolint: line_length. pre_output = NULL, post_output = NULL, ggplot2_args = teal.widgets::ggplot2_args()) { @@ -258,7 +258,7 @@ srv_tm_g_association <- function(id, output_q <- reactive({ teal::validate_inputs(iv_r()) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. teal::validate_has_data(ANL, 3) vars_names <- merged$anl_input_r()$columns_source$vars diff --git a/R/tm_g_bivariate.R b/R/tm_g_bivariate.R index 39f95e05e..460ba1b9c 100644 --- a/R/tm_g_bivariate.R +++ b/R/tm_g_bivariate.R @@ -458,7 +458,7 @@ srv_g_bivariate <- function(id, output_q <- reactive({ teal::validate_inputs(iv_r()) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. teal::validate_has_data(ANL, 3) x_col_vec <- as.vector(merged$anl_input_r()$columns_source$x) @@ -585,7 +585,7 @@ srv_g_bivariate <- function(id, substitute( expr = { # Add facetting labels - # optional: grid.newpage() # nolint commented_code_linter + # optional: grid.newpage() # nolint: commented_code. p <- add_facet_labels(p, xfacet_label = nulled_col_facet_name, yfacet_label = nulled_row_facet_name) grid::grid.newpage() grid::grid.draw(p) diff --git a/R/tm_g_distribution.R b/R/tm_g_distribution.R index d42cbf535..48a0adef4 100644 --- a/R/tm_g_distribution.R +++ b/R/tm_g_distribution.R @@ -493,7 +493,7 @@ srv_distribution <- function(id, ) } - ANL <- merged$anl_q_r()[[as.character(dist_var[[1]]$dataname)]] # nolint object_name_linter + ANL <- merged$anl_q_r()[[as.character(dist_var[[1]]$dataname)]] # nolint: object_name. params <- get_dist_params(as.numeric(stats::na.omit(ANL[[dist_var2]])), input$t_dist) params_vec <- round(unname(unlist(params)), 2) params_names <- names(params) @@ -533,7 +533,7 @@ srv_distribution <- function(id, common_q <- reactive({ # Create a private stack for this function only. - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. dist_var <- merge_vars()$dist_var s_var <- merge_vars()$s_var g_var <- merge_vars()$g_var @@ -560,7 +560,7 @@ srv_distribution <- function(id, qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL[[g_var]] <- forcats::fct_na_value_to_level(as.factor(ANL[[g_var]]), "NA"), # nolint object_name_linter + expr = ANL[[g_var]] <- forcats::fct_na_value_to_level(as.factor(ANL[[g_var]]), "NA"), # nolint: object_name. env = list(g_var = g_var) ) ) @@ -576,7 +576,7 @@ srv_distribution <- function(id, qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL[[s_var]] <- forcats::fct_na_value_to_level(as.factor(ANL[[s_var]]), "NA"), # nolint object_name_linter + expr = ANL[[s_var]] <- forcats::fct_na_value_to_level(as.factor(ANL[[s_var]]), "NA"), # nolint: object_name. env = list(s_var = s_var) ) ) @@ -994,7 +994,7 @@ srv_distribution <- function(id, }, valueExpr = { # Create a private stack for this function only. - ANL <- common_q()[["ANL"]] # nolint object_name_linter + ANL <- common_q()[["ANL"]] # nolint: object_name. dist_var <- merge_vars()$dist_var s_var <- merge_vars()$s_var diff --git a/R/tm_g_response.R b/R/tm_g_response.R index 754433d3a..3ca9acdf0 100644 --- a/R/tm_g_response.R +++ b/R/tm_g_response.R @@ -295,7 +295,7 @@ srv_g_response <- function(id, teal::validate_inputs(iv_r()) qenv <- merged$anl_q_r() - ANL <- qenv[["ANL"]] # nolint object_name_linter + ANL <- qenv[["ANL"]] # nolint: object_name. resp_var <- as.vector(merged$anl_input_r()$columns_source$response) x <- as.vector(merged$anl_input_r()$columns_source$x) @@ -332,7 +332,7 @@ srv_g_response <- function(id, qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL[[x]] <- with(ANL, forcats::fct_rev(x_cl)), # nolint object_name_linter + expr = ANL[[x]] <- with(ANL, forcats::fct_rev(x_cl)), # nolint: object_name. env = list(x = x, x_cl = x_cl) ) ) @@ -341,7 +341,7 @@ srv_g_response <- function(id, qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL[[resp_var]] <- factor(ANL[[resp_var]]), # nolint object_name_linter + expr = ANL[[resp_var]] <- factor(ANL[[resp_var]]), # nolint: object_name. env = list(resp_var = resp_var) ) ) %>% diff --git a/R/tm_g_scatterplot.R b/R/tm_g_scatterplot.R index 1cf20b3d8..9caab3f2c 100644 --- a/R/tm_g_scatterplot.R +++ b/R/tm_g_scatterplot.R @@ -485,7 +485,7 @@ srv_g_scatterplot <- function(id, ) trend_line_is_applicable <- reactive({ - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. x_var <- as.vector(merged$anl_input_r()$columns_source$x) y_var <- as.vector(merged$anl_input_r()$columns_source$y) length(x_var) > 0 && length(y_var) > 0 && is.numeric(ANL[[x_var]]) && is.numeric(ANL[[y_var]]) @@ -512,7 +512,7 @@ srv_g_scatterplot <- function(id, output$num_na_removed <- renderUI({ if (add_trend_line()) { - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. x_var <- as.vector(merged$anl_input_r()$columns_source$x) y_var <- as.vector(merged$anl_input_r()$columns_source$y) if ((num_total_na <- nrow(ANL) - nrow(stats::na.omit(ANL[, c(x_var, y_var)]))) > 0) { @@ -536,7 +536,7 @@ srv_g_scatterplot <- function(id, output_q <- reactive({ teal::validate_inputs(iv_r(), iv_facet) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. x_var <- as.vector(merged$anl_input_r()$columns_source$x) y_var <- as.vector(merged$anl_input_r()$columns_source$y) @@ -637,7 +637,7 @@ srv_g_scatterplot <- function(id, plot_q <- teal.code::eval_code( object = plot_q, code = substitute( - expr = ANL[, log_x_var] <- log_x_fn(ANL[, x_var]), # nolint object_name_linter + expr = ANL[, log_x_var] <- log_x_fn(ANL[, x_var]), # nolint: object_name. env = list( x_var = x_var, log_x_fn = as.name(log_x_fn), @@ -652,7 +652,7 @@ srv_g_scatterplot <- function(id, plot_q <- teal.code::eval_code( object = plot_q, code = substitute( - expr = ANL[, log_y_var] <- log_y_fn(ANL[, y_var]), # nolint object_name_linter + expr = ANL[, log_y_var] <- log_y_fn(ANL[, y_var]), # nolint: object_name. env = list( y_var = y_var, log_y_fn = as.name(log_y_fn), @@ -785,7 +785,7 @@ srv_g_scatterplot <- function(id, plot_q <- teal.code::eval_code( plot_q, substitute( - expr = ANL <- dplyr::filter(ANL, !is.na(x_var) & !is.na(y_var)), # nolint object_name_linter + expr = ANL <- dplyr::filter(ANL, !is.na(x_var) & !is.na(y_var)), # nolint: object_name. env = list(x_var = as.name(x_var), y_var = as.name(y_var)) ) ) diff --git a/R/tm_g_scatterplotmatrix.R b/R/tm_g_scatterplotmatrix.R index f4437161c..b82e1d41d 100644 --- a/R/tm_g_scatterplotmatrix.R +++ b/R/tm_g_scatterplotmatrix.R @@ -200,7 +200,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab teal::validate_inputs(iv_r()) qenv <- merged$anl_q_r() - ANL <- qenv[["ANL"]] # nolint object_name_linter + ANL <- qenv[["ANL"]] # nolint: object_name. cols_names <- merged$anl_input_r()$columns_source$variables alpha <- input$alpha @@ -227,7 +227,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL <- ANL[, cols_names] %>% # nolint object_name_linter + expr = ANL <- ANL[, cols_names] %>% # nolint: object_name. dplyr::mutate_if(is.character, as.factor) %>% droplevels(), env = list(cols_names = cols_names) @@ -237,7 +237,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL <- ANL[, cols_names] %>% # nolint object_name_linter + expr = ANL <- ANL[, cols_names] %>% # nolint: object_name. droplevels(), env = list(cols_names = cols_names) ) @@ -322,7 +322,7 @@ srv_g_scatterplotmatrix <- function(id, data, reporter, filter_panel_api, variab output$message <- renderText({ shiny::req(iv_r()$is_valid()) req(selector_list()$variables()) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. cols_names <- unique(unname(do.call(c, merged$anl_input_r()$columns_source))) check_char <- vapply(ANL[, cols_names], is.character, logical(1)) if (any(check_char)) { diff --git a/R/tm_missing_data.R b/R/tm_missing_data.R index 60a8f33f4..64a81c968 100644 --- a/R/tm_missing_data.R +++ b/R/tm_missing_data.R @@ -425,14 +425,14 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par teal.code::eval_code( data(), substitute( - expr = ANL <- anl_name[, selected_vars, drop = FALSE], # nolint object_name_linter + expr = ANL <- anl_name[, selected_vars, drop = FALSE], # nolint: object_name. env = list(anl_name = as.name(dataname), selected_vars = selected_vars()) ) ) } else { teal.code::eval_code( data(), - substitute(expr = ANL <- anl_name, env = list(anl_name = as.name(dataname))) # nolint object_name_linter + substitute(expr = ANL <- anl_name, env = list(anl_name = as.name(dataname))) # nolint: object_name. ) } @@ -440,7 +440,7 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL[[group_var]] <- anl_name[[group_var]], # nolint object_name_linter + expr = ANL[[group_var]] <- anl_name[[group_var]], # nolint: object_name. env = list(group_var = group_var, anl_name = as.name(dataname)) ) ) @@ -590,7 +590,7 @@ srv_missing_data <- function(id, data, reporter, filter_panel_api, dataname, par qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL[[new_col_name]] <- ifelse(rowSums(is.na(ANL)) > 0, NA, FALSE), # nolint object_name_linter + expr = ANL[[new_col_name]] <- ifelse(rowSums(is.na(ANL)) > 0, NA, FALSE), # nolint: object_name. env = list(new_col_name = new_col_name) ) ) diff --git a/R/tm_outliers.R b/R/tm_outliers.R index 40b3c728d..e58d2c53f 100644 --- a/R/tm_outliers.R +++ b/R/tm_outliers.R @@ -311,7 +311,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, n_outlier_missing <- reactive({ shiny::req(iv_r()$is_valid()) outlier_var <- as.vector(merged$anl_input_r()$columns_source$outlier_var) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. sum(is.na(ANL[[outlier_var]])) }) @@ -321,7 +321,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, common_code_q <- reactive({ shiny::req(iv_r()$is_valid()) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. qenv <- merged$anl_q_r() outlier_var <- as.vector(merged$anl_input_r()$columns_source$outlier_var) @@ -350,7 +350,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL <- ANL %>% dplyr::filter(!is.na(outlier_var_name)), # nolint object_name_linter + expr = ANL <- ANL %>% dplyr::filter(!is.na(outlier_var_name)), # nolint: object_name. env = list(outlier_var_name = as.name(outlier_var)) ) ) @@ -367,7 +367,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, qenv <- teal.code::eval_code( qenv, substitute( - expr = ANL <- ANL %>% dplyr::filter(!is.na(outlier_var_name)), # nolint object_name_linter + expr = ANL <- ANL %>% dplyr::filter(!is.na(outlier_var_name)), # nolint: object_name. env = list(outlier_var_name = as.name(outlier_var)) ) ) @@ -399,7 +399,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, qenv, substitute( expr = { - ANL_OUTLIER <- ANL %>% # nolint object_name_linter + ANL_OUTLIER <- ANL %>% # nolint: object_name. group_expr %>% # styler: off dplyr::mutate(is_outlier = { q1_q3 <- stats::quantile(outlier_var_name, probs = c(0.25, 0.75)) @@ -465,7 +465,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, qenv, substitute( expr = { - ANL_OUTLIER_EXTENDED <- dplyr::left_join( # nolint object_name_linter + ANL_OUTLIER_EXTENDED <- dplyr::left_join( # nolint: object_name. ANL_OUTLIER, dplyr::select( dataname, @@ -544,13 +544,13 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, # In order for geom_rug to work properly when reordering takes place inside facet_grid, # all tables must have the column used for reording. # In this case, the column used for reordering is `order`. - ANL_OUTLIER <- dplyr::left_join( # nolint object_name_linter + ANL_OUTLIER <- dplyr::left_join( # nolint: object_name. ANL_OUTLIER, summary_table_pre[, c("order", categorical_var)], by = categorical_var ) # so that x axis of plot aligns with columns of summary table, from most outliers to least by percentage - ANL <- ANL %>% # nolint object_name_linter + ANL <- ANL %>% # nolint: object_name. dplyr::left_join( dplyr::select(summary_table_pre, categorical_var_name, order), by = categorical_var @@ -602,11 +602,11 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, } ) - # boxplot/violinplot # nolint commented_code_linter + # boxplot/violinplot # nolint commented_code boxplot_q <- reactive({ req(common_code_q()) - ANL <- common_code_q()[["ANL"]] # nolint object_name_linter - ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint object_name_linter + ANL <- common_code_q()[["ANL"]] # nolint: object_name. + ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint: object_name. outlier_var <- as.vector(merged$anl_input_r()$columns_source$outlier_var) categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var) @@ -697,8 +697,8 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, # density plot density_plot_q <- reactive({ - ANL <- common_code_q()[["ANL"]] # nolint object_name_linter - ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint object_name_linter + ANL <- common_code_q()[["ANL"]] # nolint: object_name. + ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint: object_name. outlier_var <- as.vector(merged$anl_input_r()$columns_source$outlier_var) categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var) @@ -757,8 +757,8 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, # Cumulative distribution plot cumulative_plot_q <- reactive({ - ANL <- common_code_q()[["ANL"]] # nolint object_name_linter - ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint object_name_linter + ANL <- common_code_q()[["ANL"]] # nolint: object_name. + ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint: object_name. qenv <- common_code_q() @@ -802,7 +802,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, all_categories <- lapply( unique(ANL[[categorical_var]]), function(x) { - ANL <- ANL %>% dplyr::filter(get(categorical_var) == x) # nolint object_name_linter + ANL <- ANL %>% dplyr::filter(get(categorical_var) == x) # nolint: object_name. anl_outlier2 <- ANL_OUTLIER %>% dplyr::filter(get(categorical_var) == x) ecdf_df <- ANL %>% dplyr::mutate(y = stats::ecdf(ANL[[outlier_var]])(ANL[[outlier_var]])) @@ -979,7 +979,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, choices <- teal.transform::variable_choices(data()[[dataname_first]]) observeEvent(common_code_q(), { - ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint object_name_linter + ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint: object_name. teal.widgets::updateOptionalSelectInput( session, inputId = "table_ui_columns", @@ -995,9 +995,9 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, outlier_var <- as.vector(merged$anl_input_r()$columns_source$outlier_var) categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var) - ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint object_name_linter - ANL_OUTLIER_EXTENDED <- common_code_q()[["ANL_OUTLIER_EXTENDED"]] # nolint object_name_linter - ANL <- common_code_q()[["ANL"]] # nolint object_name_linter + ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint: object_name. + ANL_OUTLIER_EXTENDED <- common_code_q()[["ANL_OUTLIER_EXTENDED"]] # nolint: object_name. + ANL <- common_code_q()[["ANL"]] # nolint: object_name. plot_brush <- if (tab == "Boxplot") { boxplot_r() box_pws$brush() @@ -1010,7 +1010,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, } # removing unused column ASAP - ANL_OUTLIER$order <- ANL$order <- NULL # nolint object_name_linter + ANL_OUTLIER$order <- ANL$order <- NULL # nolint: object_name. display_table <- if (!is.null(plot_brush)) { if (length(categorical_var) > 0) { @@ -1026,7 +1026,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, if (tab == "Boxplot") { # in boxplot with no categorical variable, there is no column in ANL that would correspond to x-axis # so a column needs to be inserted with the value "Entire dataset" because that's the label used in plot - ANL[[plot_brush$mapping$x]] <- "Entire dataset" # nolint object_name_linter + ANL[[plot_brush$mapping$x]] <- "Entire dataset" # nolint: object_name. } } @@ -1034,15 +1034,16 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, # so they need to be computed and attached to ANL if (tab == "Density Plot") { plot_brush$mapping$y <- "density" - ANL$density <- plot_brush$ymin # nolint #either ymin or ymax will work + ANL$density <- plot_brush$ymin # nolint: object_name. + # either ymin or ymax will work } else if (tab == "Cumulative Distribution Plot") { plot_brush$mapping$y <- "cdf" if (length(categorical_var) > 0) { - ANL <- ANL %>% # nolint object_name_linter + ANL <- ANL %>% # nolint: object_name. dplyr::group_by(!!as.name(plot_brush$mapping$panelvar1)) %>% dplyr::mutate(cdf = stats::ecdf(!!as.name(outlier_var))(!!as.name(outlier_var))) } else { - ANL$cdf <- stats::ecdf(ANL[[outlier_var]])(ANL[[outlier_var]]) # nolint object_name_linter + ANL$cdf <- stats::ecdf(ANL[[outlier_var]])(ANL[[outlier_var]]) # nolint: object_name. } } @@ -1087,10 +1088,10 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, output$total_outliers <- renderUI({ shiny::req(iv_r()$is_valid()) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter - ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. + ANL_OUTLIER <- common_code_q()[["ANL_OUTLIER"]] # nolint: object_name. teal::validate_has_data(ANL, 1) - ANL_OUTLIER_SELECTED <- ANL_OUTLIER[ANL_OUTLIER$is_outlier_selected, ] # nolint object_name_linter + ANL_OUTLIER_SELECTED <- ANL_OUTLIER[ANL_OUTLIER$is_outlier_selected, ] # nolint: object_name. h5( sprintf( "%s %d / %d [%.02f%%]", @@ -1104,7 +1105,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var, output$total_missing <- renderUI({ if (n_outlier_missing() > 0) { - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. helpText( sprintf( "%s %d / %d [%.02f%%]", diff --git a/R/tm_t_crosstable.R b/R/tm_t_crosstable.R index 4aecdb030..809956335 100644 --- a/R/tm_t_crosstable.R +++ b/R/tm_t_crosstable.R @@ -233,7 +233,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, output_q <- reactive({ teal::validate_inputs(iv_r()) - ANL <- merged$anl_q_r()[["ANL"]] # nolint object_name_linter + ANL <- merged$anl_q_r()[["ANL"]] # nolint: object_name. # As this is a summary x_name <- as.vector(merged$anl_input_r()$columns_source$x) @@ -317,7 +317,7 @@ srv_t_crosstable <- function(id, data, reporter, filter_panel_api, label, x, y, teal.code::eval_code( substitute( expr = { - ANL <- tern::df_explicit_na(ANL) # nolint object_name_linter + ANL <- tern::df_explicit_na(ANL) # nolint: object_name. tbl <- rtables::build_table(lyt = lyt, df = ANL[order(ANL[[y_name]]), ]) tbl }, diff --git a/R/tm_variable_browser.R b/R/tm_variable_browser.R index a68ff2a0e..71730bff8 100644 --- a/R/tm_variable_browser.R +++ b/R/tm_variable_browser.R @@ -181,7 +181,7 @@ srv_variable_browser <- function(id, .unique_records_for_factor <- 30 # if there are < this number of unique records then a numeric # variable is by default treated as a factor - .unique_records_default_as_factor <- 6 # nolint object_length_linter + .unique_records_default_as_factor <- 6 # nolint: object_length. datanames <- isolate(teal.data::datanames(data())) datanames <- Filter(function(name) { @@ -879,7 +879,7 @@ plot_var_summary <- function(var, wrap_character = NULL, numeric_as_factor, display_density = is.numeric(var), - remove_NA_hist = FALSE, # nolint object_name_linter + remove_NA_hist = FALSE, # nolint: object_name. outlier_definition, records_for_factor, ggplot2_args) { diff --git a/data-raw/data.R b/data-raw/data.R index ab21d2721..10d16120e 100644 --- a/data-raw/data.R +++ b/data-raw/data.R @@ -1,16 +1,16 @@ ## code to prepare `data` for testing examples library(scda) -rADAE <- synthetic_cdisc_data("latest")$adae # nolint object_name_linter +rADAE <- synthetic_cdisc_data("latest")$adae # nolint: object_name. usethis::use_data(rADAE) -rADLB <- synthetic_cdisc_data("latest")$adlb # nolint object_name_linter +rADLB <- synthetic_cdisc_data("latest")$adlb # nolint: object_name. usethis::use_data(rADLB) -rADRS <- synthetic_cdisc_data("latest")$adrs # nolint object_name_linter +rADRS <- synthetic_cdisc_data("latest")$adrs # nolint: object_name. usethis::use_data(rADRS) -rADSL <- synthetic_cdisc_data("latest")$adsl # nolint object_name_linter +rADSL <- synthetic_cdisc_data("latest")$adsl # nolint: object_name. usethis::use_data(rADSL) -rADTTE <- synthetic_cdisc_data("latest")$adtte # nolint object_name_linter +rADTTE <- synthetic_cdisc_data("latest")$adtte # nolint: object_name. usethis::use_data(rADTTE)