From 9d8c7768a61a8b49f47887ec4536326a05e22029 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Sat, 7 Oct 2023 19:58:18 +0200 Subject: [PATCH] lints --- R/plot.check_outliers.R | 14 +++++++------- R/plot.check_outliers_new.R | 2 +- R/plot.compare_performance.R | 8 ++++---- R/plot.describe_distribution.R | 2 +- R/plot.estimate_contrasts.R | 12 ++++++------ R/plot.estimate_density.R | 10 +++++----- R/plot.hdi.R | 8 ++++---- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/R/plot.check_outliers.R b/R/plot.check_outliers.R index 4cf04f5c8..eae2b173f 100644 --- a/R/plot.check_outliers.R +++ b/R/plot.check_outliers.R @@ -97,13 +97,13 @@ data_plot.check_outliers <- function(x, data = NULL, rescale_distance = TRUE, .. d$Id[d$Outliers == "0"] <- NA method <- switch(attr(x, "method", exact = TRUE), - "cook" = "Cook's Distance", - "pareto" = "Pareto", - "mahalanobis" = "Mahalanobis Distance", - "ics" = "Invariant Coordinate Selection", - "mcd" = "Minimum Covariance Determinant", - "optics" = "OPTICS", - "iforest" = "Isolation Forest", + cook = "Cook's Distance", + pareto = "Pareto", + mahalanobis = "Mahalanobis Distance", + ics = "Invariant Coordinate Selection", + mcd = "Minimum Covariance Determinant", + optics = "OPTICS", + iforest = "Isolation Forest", "Cook's Distance" ) diff --git a/R/plot.check_outliers_new.R b/R/plot.check_outliers_new.R index b8d895dd0..9ade11d2e 100644 --- a/R/plot.check_outliers_new.R +++ b/R/plot.check_outliers_new.R @@ -44,7 +44,7 @@ se = FALSE, color = colors[1] ) + - scale_colour_manual(values = c("OK" = colors[2], "Influential" = colors[3])) + + scale_colour_manual(values = c(OK = colors[2], Influential = colors[3])) + (if (isTRUE(show_labels)) { if (requireNamespace("ggrepel", quietly = TRUE)) { ggrepel::geom_text_repel( diff --git a/R/plot.compare_performance.R b/R/plot.compare_performance.R index 3db5c7871..c61c42fce 100644 --- a/R/plot.compare_performance.R +++ b/R/plot.compare_performance.R @@ -40,10 +40,10 @@ data_plot.compare_performance <- function(x, data = NULL, ...) { dataplot$values[dataplot$values > 1] <- 1 attr(dataplot, "info") <- list( - "xlab" = "", - "ylab" = "", - "title" = "Comparison of Model Indices", - "legend_color" = "Models" + xlab = "", + ylab = "", + title = "Comparison of Model Indices", + legend_color = "Models" ) class(dataplot) <- c("data_plot", "see_compare_performance", "data.frame") diff --git a/R/plot.describe_distribution.R b/R/plot.describe_distribution.R index 4f3012b72..653c594a0 100644 --- a/R/plot.describe_distribution.R +++ b/R/plot.describe_distribution.R @@ -199,7 +199,7 @@ plot.see_parameters_distribution <- function(x, } names(highlight_color) <- highlight - highlight_color <- c(highlight_color, "no_highlight" = "grey70") + highlight_color <- c(highlight_color, no_highlight = "grey70") p <- p + scale_fill_manual(values = highlight_color) + diff --git a/R/plot.estimate_contrasts.R b/R/plot.estimate_contrasts.R index d2f329b89..2dbfbbfeb 100644 --- a/R/plot.estimate_contrasts.R +++ b/R/plot.estimate_contrasts.R @@ -16,9 +16,9 @@ data_plot.estimate_contrasts <- function(x, data = NULL, ...) { dataplot <- .data_contrasts_and_means(x, means, x_name = x_name, y_name = y_name) attr(dataplot, "info") <- list( - "xlab" = x_name, - "ylab" = y_name, - "title" = paste0("Estimated ", y_name, "s and Contrasts") + xlab = x_name, + ylab = y_name, + title = paste0("Estimated ", y_name, "s and Contrasts") ) class(dataplot) <- c("data_plot", "see_estimate_contrasts", class(dataplot)) @@ -45,9 +45,9 @@ data_plot.estimate_contrasts <- function(x, data = NULL, ...) { polygons <- merge(polygons, data_means[c("Level2", "Mean2")], by = "Level2") polygons <- rbind( - cbind(polygons, data.frame("x" = polygons$Level1, "y" = polygons$Mean1)), - cbind(polygons, data.frame("x" = polygons$Level2, "y" = polygons$Mean1 - polygons$CI_low)), - cbind(polygons, data.frame("x" = polygons$Level2, "y" = polygons$Mean1 - polygons$CI_high)) + cbind(polygons, data.frame(x = polygons$Level1, y = polygons$Mean1)), + cbind(polygons, data.frame(x = polygons$Level2, y = polygons$Mean1 - polygons$CI_low)), + cbind(polygons, data.frame(x = polygons$Level2, y = polygons$Mean1 - polygons$CI_high)) ) list( diff --git a/R/plot.estimate_density.R b/R/plot.estimate_density.R index f472bcad7..ad431a8c6 100644 --- a/R/plot.estimate_density.R +++ b/R/plot.estimate_density.R @@ -51,11 +51,11 @@ data_plot.estimate_density <- function(x, attr(dataplot, "summary") <- summary attr(dataplot, "info") <- list( - "xlab" = "Values", - "ylab" = "Density", - "legend_fill" = "Parameter", - "legend_color" = "Parameter", - "title" = "Estimated Density Function" + xlab = "Values", + ylab = "Density", + legend_fill = "Parameter", + legend_color = "Parameter", + title = "Estimated Density Function" ) class(dataplot) <- c("data_plot", "see_estimate_density", class(dataplot)) diff --git a/R/plot.hdi.R b/R/plot.hdi.R index bab66afe9..03b33e79c 100644 --- a/R/plot.hdi.R +++ b/R/plot.hdi.R @@ -121,10 +121,10 @@ data_plot.bayestestR_eti <- data_plot.hdi dataplot <- .fix_facet_names(dataplot) attr(dataplot, "info") <- list( - "xlab" = "Possible parameter values", - "ylab" = ylab, - "legend_fill" = legend_title, - "title" = plot_title + xlab = "Possible parameter values", + ylab = ylab, + legend_fill = legend_title, + title = plot_title ) class(dataplot) <- c("data_plot", "see_hdi", class(dataplot))