Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Oct 7, 2023
1 parent 48c7d9e commit 9d8c776
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
14 changes: 7 additions & 7 deletions R/plot.check_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion R/plot.check_outliers_new.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions R/plot.compare_performance.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion R/plot.describe_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand Down
12 changes: 6 additions & 6 deletions R/plot.estimate_contrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions R/plot.estimate_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
8 changes: 4 additions & 4 deletions R/plot.hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9d8c776

Please sign in to comment.