R/kable_statsDesc.R

Defines functions kable_statsDesc

Documented in kable_statsDesc

#' Statistiques descriptives
#'
#' @param x Tableau d'une ligne indiquant les statistiques descriptives.
#'
#' @keywords internal
#' @import kableExtra
#' @export
kable_statsDesc <- function(x){
  return(
    kable(
      x = cbind(x[, lapply(.SD, formatr), .SDcols = 1:(ncol(x)-1)],  # les statistiques
                x[, lapply(.SD, formatr, 0), .SDcols = ncol(x)]),  # nombre d'individus
      format = "latex",
      booktabs = TRUE,
      row.names = FALSE,
      linesep = "",
      align = "r"
    ) %>%
      kable_styling(
        latex_options = c("hold_position",
                          "repeat_header"),
        position = "center"
      )
  )
}
INESSS-QC/polymed1 documentation built on Aug. 4, 2020, 12:02 a.m.