From 02f54ab73a0755bcba64dae3e16cbbe4ad42a220 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Peixoto Date: Mon, 27 May 2024 23:03:06 -0400 Subject: [PATCH] fix referencing dplyr bug in vizClusters --- R/visualization.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/visualization.R b/R/visualization.R index 7ba3a47..b3ab3dc 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -47,9 +47,9 @@ vizClusters <- function(cells, ofInterest = NULL, ## separate cells of interest to plot on top of others if(!is.null(ofInterest)){ cells <- cells %>% - mutate(celltypes = - case_when((!cells$celltypes %in% ofInterest) ~ 'other', - T ~ celltypes)) + dplyr::mutate(celltypes = + dplyr::case_when((!cells$celltypes %in% ofInterest) ~ 'other', + T ~ celltypes)) # cells$celltypes <- droplevels(cells$celltypes) } @@ -57,7 +57,7 @@ vizClusters <- function(cells, ofInterest = NULL, ordered_cts <- c(names(sort(table(cells$celltypes), decreasing = T))) ordered_cts <- c('other', ordered_cts[ordered_cts != 'other']) cells <- cells %>% - arrange(match(celltypes, ordered_cts)) + dplyr::arrange(match(celltypes, ordered_cts)) ## plot plt <- ggplot2::ggplot() +