Learn R Programming

statAfrikR (version 0.2.1)

tableau_descriptif: Tableau de statistiques descriptives institutionnel

Description

Produit un tableau de statistiques descriptives pondere, formate selon les conventions des INS africains. Exportable en Word (flextable) ou Excel (openxlsx2).

Usage

tableau_descriptif(
  data,
  vars,
  poids = NULL,
  par = NULL,
  stats = c("n", "moyenne", "mediane", "ecart_type", "min", "max", "ic"),
  format = c("tibble", "flextable", "excel"),
  chemin = NULL,
  titre = NULL,
  source = NULL
)

Value

Tibble, flextable ou chemin fichier Excel

Arguments

data

data.frame, tibble ou objet svydesign -- Donnees

vars

character -- Variables numeriques a analyser

poids

character ou NULL -- Variable de ponderation. Defaut : NULL

par

character ou NULL -- Variable de ventilation (groupe). Defaut : NULL

stats

character -- Statistiques parmi : "n", "moyenne", "mediane", "ecart_type", "min", "max", "ic". Defaut : toutes

format

character -- "tibble", "flextable" ou "excel". Defaut : "tibble"

chemin

character ou NULL -- Chemin Excel. Defaut : NULL

titre

character ou NULL -- Titre du tableau. Defaut : NULL

source

character ou NULL -- Note source. Defaut : NULL

Examples

Run this code
set.seed(42)
donnees <- data.frame(
  age    = sample(18:65, 200, replace = TRUE),
  revenu = rexp(200, rate = 1/250000),
  poids  = runif(200, 0.8, 1.3),
  milieu = sample(c("urbain", "rural"), 200, TRUE)
)
tableau_descriptif(donnees, vars = c("age", "revenu"), poids = "poids")

Run the code above in your browser using DataLab