Skip to content

Commit

Permalink
fix check for by in complex plot
Browse files Browse the repository at this point in the history
  • Loading branch information
gdagstn authored Apr 4, 2023
1 parent 62bd6c6 commit eb26df7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/plotting.R
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ seg_feature_complex_plot <- function(segmentation, feature, assay,
if (!is(feature, "character")) stop("feature must be a character.")
if (!feature %in% rownames(segmentation@assays[[assay]]@values)) stop(paste0("Feature ", feature, " cannot be found in the row names of assay ", assay, "."))

if (length(by) != 2) stop("Argument `by` must contain exactly 2 elements: name of the column in `sampledata` and value of the column")
if (!is.null(by) & length(by) != 2) stop("Argument `by` must contain exactly 2 elements: name of the column in `sampledata` and value of the column")
if (!is.null(by) & is.null(aggr_fun)) stop("If `by` is not NULL you must specify an aggregation function for `aggr_fun`.")

if (is.null(color_pal)) cpal <- colorspace::sequential_hcl(palette = "Sunset", n = 25) else cpal <- color_pal
Expand Down

0 comments on commit eb26df7

Please sign in to comment.