R/pool_plates.R

Defines functions pool_plates

Documented in pool_plates

#' Preaverage plates
#'
#' The \code{Luminescence} column will be averaged for each \code{Formulation}.
#'
#' @param df The data frame on which to perform preaveraging.
#'
#' @return The preaveraged data frame.
#' @export
#' @importFrom magrittr %>%
#' @importFrom dplyr group_by summarize ungroup first
#'
#' @examples
#' pool_plates(some.df)
pool_plates <- function(df) {
  df %>%
    group_by(Plate, Formulation) %>%
    summarize(Core = first(Core),
              DOPE = first(DOPE),
              Chol = first(Chol),
              PEG = first(PEG),
              Luminescence = mean(Luminescence)) %>%
    ungroup
}
Aehmlo/lucy documentation built on Oct. 30, 2019, 4:09 a.m.