Skip to content

Commit

Permalink
restore aes_args
Browse files Browse the repository at this point in the history
  • Loading branch information
himmil committed Oct 18, 2023
1 parent 4dce786 commit 796bf84
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions R/utils_plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ NULL
aes_args <- aes()

if (!is.null(colour_by)) {
aes_args$fill <- substitute(.data[["colour_by"]])
aes_args$fill <- substitute(`colour_by`)
}
if(!is.null(add_border) && add_border && !is.null(colour_by)){
border <- TRUE
aes_args$colour <- substitute(.data[["colour_by"]])
aes_args$colour <- substitute(`colour_by`)
} else if(is.null(add_border) && n <= 20) {
border <- TRUE
aes_args$colour <- substitute(.data[["colour_by"]])
aes_args$colour <- substitute(`colour_by`)
}
new_aes <- do.call(aes, aes_args)
geom_args <- list(mapping = new_aes, alpha = alpha)
Expand All @@ -286,19 +286,19 @@ NULL
aes_args <- aes()
fill_colour <- TRUE
if (!is.null(shape_by)) {
aes_args$shape <- substitute(.data[["shape_by"]])
aes_args$shape <- substitute(`shape_by`)
}
if (!is.null(colour_by)) {
# Only shapes 21 to 25 can be filled. Filling does not work in other shapes.
if(shape >= 21 && shape <= 25){
aes_args$fill <- substitute(.data[["colour_by"]])
aes_args$fill <- substitute(`colour_by`)
} else {
aes_args$colour <- subsitute(.data[["colour_by"]])
aes_args$colour <- subsitute(`colour_by`)
fill_colour <- FALSE
}
}
if (!is.null(size_by)) {
aes_args$size <- substitute(.data[["size_by"]])
aes_args$size <- substitute(`size_by`)
}
new_aes <- do.call(aes, aes_args)
geom_args <- list(mapping = new_aes, alpha = alpha)
Expand All @@ -322,13 +322,13 @@ NULL
{
aes_args <- aes()
if (!is.null(linetype_by)) {
aes_args$linetype <- substitute(.data[["linetype_by"]])
aes_args$linetype <- substitute(`linetype_by`)
}
if (!is.null(colour_by)) {
aes_args$colour <- substitute(.data[["colour_by"]])
aes_args$colour <- substitute(`colour_by`)
}
if (!is.null(size_by)) {
aes_args$linewidth <- substitute(.data[["size_by"]])
aes_args$linewidth <- substitute(`size_by`)
}
new_aes <- do.call(aes, aes_args)
geom_args <- list(mapping = new_aes, alpha = alpha)
Expand All @@ -349,7 +349,7 @@ NULL
{
aes_args <- aes(ymin = .data[["Y"]] - .data[["sd"]], ymax = .data[["Y"]] + .data[["sd"]])
if (!is.null(colour_by)) {
aes_args$fill <- substitute(.data[["colour_by"]])
aes_args$fill <- substitute(`colour_by`)
}
new_aes <- do.call(aes, aes_args)
geom_args <- list(mapping = new_aes, alpha = alpha)
Expand All @@ -363,10 +363,10 @@ NULL
layout = NULL){
aes_args <- aes()
if (!is.null(edge_colour_by)) {
aes_args$colour <- substitute(.data[["edge_colour_by"]])
aes_args$colour <- substitute(`edge_colour_by`)
}
if (!is.null(edge_size_by)) {
aes_args$size <- substitute(.data[["edge_size_by"]])
aes_args$size <- substitute(`edge_size_by`)
}
new_aes <- do.call(aes, aes_args)
geom_args <- list(mapping = new_aes, alpha = alpha)
Expand Down Expand Up @@ -410,8 +410,8 @@ NULL
fill_colour <- TRUE
aes_args <- aes()
if (!is.null(colour_by)) {
aes_args$colour <- substitute(.data[["colour_by"]])
aes_args$fill <- substitute(.datda[["colour_by"]])
aes_args$colour <- substitute(`colour_by`)
aes_args$fill <- substitute(`colour_by`)
}
new_aes <- do.call(aes, aes_args)
geom_args <- list(mapping = new_aes,
Expand Down

0 comments on commit 796bf84

Please sign in to comment.