Skip to content

Commit eb26df7

Browse files
authored
fix check for by in complex plot
1 parent 62bd6c6 commit eb26df7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/plotting.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ seg_feature_complex_plot <- function(segmentation, feature, assay,
619619
if (!is(feature, "character")) stop("feature must be a character.")
620620
if (!feature %in% rownames(segmentation@assays[[assay]]@values)) stop(paste0("Feature ", feature, " cannot be found in the row names of assay ", assay, "."))
621621

622-
if (length(by) != 2) stop("Argument `by` must contain exactly 2 elements: name of the column in `sampledata` and value of the column")
622+
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")
623623
if (!is.null(by) & is.null(aggr_fun)) stop("If `by` is not NULL you must specify an aggregation function for `aggr_fun`.")
624624

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

0 commit comments

Comments
 (0)