R/tag_well.R

Defines functions tag_well

Documented in tag_well

#' Assign experiment group to a well
#'
#' @param experiment_setup a data.frame with two columns, group label and number of replicates
#'
#' @import dplyr
#' @import purrr
#' @import tidyr
#' @export
tag_well <- function(experiment_setup) {
    experiment_setup %>% 
        filter(Group != "Background") %>% 
        mutate(Tag = map2(Group, n, ~rep(.x, each = .y))) %>% 
        select(Tag) %>% 
        unnest(Tag) %>% 
        unlist() %>% 
        as.character()
}
XiangZhangSC/rwave documentation built on Aug. 26, 2020, 10:34 a.m.