Commit 05de17cc authored by Korsunskiy's avatar Korsunskiy
Browse files

added utils file for dplyr pipe operator

parent 43cd3057
Loading
Loading
Loading
Loading

R/%

deleted100644 → 0
+0 −11
Original line number Diff line number Diff line
        y <- Seurat::FetchData(X, group_by) %>% unlist %>% as.character()
    } else if (!group_by %in% names(SummarizedExperiment::colData(X))) {
        idx_use <- which(y %in% intersect(groups_use, y))
    group_pct <- sweep(group_nnz, 1, as.numeric(table(y)), "/") %>% t()
    group_pct_out <- -group_nnz %>%
        sweep(2, colSums(group_nnz) , "+") %>% 
        sweep(1, as.numeric(length(y) - table(y)), "/") %>% t()
    group_means <- sweep(group_sums, 1, as.numeric(table(y)), "/") %>% t()
    res <- Reduce(cbind, lapply(wide_res, as.numeric)) %>% data.frame()
    }) %>% unlist
    usigma <- sqrt(matrix(n1n2, ncol = 1) %*% matrix(rhs, nrow = 1))

R/utils.R

0 → 100644
+14 −0
Original line number Diff line number Diff line
#' Pipe operator
#'
#' @name %>%
#' @rdname pipe
#' @keywords internal
#' @export
#' @importFrom dplyr %>%
#' @examples
#' x <- 5 %>% sum(10)
#' 
#' @usage lhs \%>\% rhs
#' @return return value of rhs function. 
NULL