R/printLogicalPct.R

#' Functions to get frequency and column percent
#' @description Functions to get frequency and column percent, used by createNiceTable()

printLogicalPct <- function(vec) {
  if (is.factor(vec)) {
    ""
  } else {
    sprintf("%s (%.1f%%)",pInt(sum(vec, na.rm=TRUE)),sum(vec,na.rm=TRUE)/length(vec)*100)
  }
}
mssm-msf-2019/BiostatsALL documentation built on May 22, 2019, 12:16 p.m.