#' add_pourcent
#'
#' Ajoute les pourcentage de chaque colonnes "f", "m" et "Total".
#'
#' @param x data
#'
#' @keywords internal
#' @return data + pourcentage de chaque colonnes.
#' @import data.table
#' @export
add_pourcent <- function(x){
# Ajouter les pourcentages pour toutes les colonnes
x[, f := paste0(f," (",format(round(f/(sum(f)/2)*100, 2), nsmall = 2, decimal.mark = ","),"%)")]
x[, m := paste0(m," (",format(round(m/(sum(m)/2)*100, 2), nsmall = 2, decimal.mark = ","),"%)")]
x[, Total := paste0(Total," (",format(round(Total/(sum(Total)/2)*100, 2), nsmall = 2, decimal.mark = ","),"%)")]
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.