Skip to content

Commit

Permalink
clean more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Nov 1, 2022
1 parent 20c18c0 commit 31661ae
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions R/plot.estimate_density.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ plot.see_estimate_density <- function(x,
# remove intercept from output, if requested
x <- .remove_intercept(x, show_intercept = show_intercept)

if (stack == TRUE) {
if (stack) {
p <- ggplot(x, aes(x = .data$x, y = .data$y, color = .data$Parameter)) +
geom_line(size = size_line) +
add_plot_attributes(x) +
Expand Down Expand Up @@ -248,7 +248,7 @@ plot.see_estimate_density_df <- function(x,
x$Parameter <- factor(x$Parameter, levels = rev(unique(x$Parameter)))
labels <- stats::setNames(levels(x$Parameter), levels(x$Parameter))

if (stack == TRUE) {
if (stack) {
p <- ggplot(x, aes(x = .data$x, y = .data$y, color = .data$Parameter)) +
geom_line(size = size_line)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/plot.hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ plot.see_hdi <- function(x,
p <- p + geom_vline(xintercept = 0, linetype = "dotted")
}

if (show_title == FALSE) {
if (!show_title) {
p <- p + ggtitle("")
}

Expand Down
4 changes: 2 additions & 2 deletions R/plot.parameters_brms_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ data_plot.parameters_brms_meta <- function(x, data = NULL, normalize_height = TR
summary$Parameter <- factor(summary$Parameter, levels = rev(unique(summary$Parameter)))
colnames(summary)[match("Parameter", colnames(summary))] <- "Study"

summary$x <- as.numeric(NA)
summary$y <- as.numeric(NA)
summary$x <- NA_real_
summary$y <- NA_real_
summary$Color <- "Study"
summary$Color[summary$Study == "Overall"] <- "Overall"

Expand Down
2 changes: 1 addition & 1 deletion R/plot.parameters_sem.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ data_plot.parameters_sem <- function(x,
rownames(edges) <- NULL

# Labels
if (ci == TRUE) {
if (ci) {
edges$Label <- paste0(
sprintf("%.2f, ", edges$Coefficient),
attributes(x)$ci * 100,
Expand Down
6 changes: 3 additions & 3 deletions R/utils_add_prior_layer.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
x = .data$x,
y = as.factor(.data$Parameter),
height = .data$y,
group = as.factor(.data$Parameter),
group = as.factor(.data$Parameter)
),
fill = fill_color,
alpha = priors_alpha
Expand All @@ -51,7 +51,7 @@
x = .data$x,
y = as.factor(.data$Parameter),
height = .data$y,
group = as.factor(.data$Parameter),
group = as.factor(.data$Parameter)
),
fill = fill_color,
alpha = priors_alpha,
Expand Down Expand Up @@ -130,7 +130,7 @@
x = .data$x,
ymin = 0,
ymax = .data$y,
group = as.factor(.data$Parameter),
group = as.factor(.data$Parameter)
),
fill = fill_color,
alpha = priors_alpha
Expand Down
2 changes: 1 addition & 1 deletion WIP/how_to_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ how_to_plot.see_estimate_density <- how_to_plot.estimate_density
#' @keywords internal
.how_to_plode_cleaner <- function(name) {
sourcecode <- utils::getAnywhere(name)
code <- sourcecode$objs[sourcecode$dups == FALSE]
code <- sourcecode$objs[!sourcecode$dups]
code <- as.character(code)
# Split by line
code <- strsplit(code, "\n", fixed = TRUE)[[1]]
Expand Down

0 comments on commit 31661ae

Please sign in to comment.