R/prepSlopeHealthDataAnnotation.R

Defines functions prepSlopeHealthDataAnnotation

Documented in prepSlopeHealthDataAnnotation

#' Prepare the data for annotating the slope health plot
#'
#' This function starts with the \code{dfout} data frame, and puts that
#' through a \code{dplyr} wringer to calculate the number of cases
#' in each of the 6 different entanglement types.
#' 
#' @return \code{dfn} A data frame containing the tally of the number of
#' events in each entanglement type.
#' @export
#' @examples
#' \dontrun{
#' prepSlopeHealthDataAnnotation(dfout)
#' }
prepSlopeHealthDataAnnotation <- function(dfout){
  
  dfn <- dfout %>% 
    group_by(gearInj) %>% 
    summarise(n = n_distinct(egno))
  dfn

}
robschick/tangled documentation built on March 19, 2018, 1:15 p.m.