View source: R/visualisation.R
| exporter_graphique | R Documentation |
Exporte un objet ggplot en PNG, PDF ou SVG avec les paramètres optimaux pour publication officielle.
exporter_graphique(
graphique,
chemin,
largeur = 20,
hauteur = 14,
dpi = 300L,
fond = "white"
)
graphique |
ggplot — Objet graphique à exporter |
chemin |
character — Chemin de sortie avec extension (.png, .pdf, .svg) |
largeur |
numeric — Largeur en cm. Défaut : 20. |
hauteur |
numeric — Hauteur en cm. Défaut : 14. |
dpi |
integer — Résolution pour PNG (ignoré pour PDF/SVG). Défaut : 300. |
fond |
character — Couleur de fond. Défaut : "white". |
Chemin du fichier exporté (invisible).
## Not run:
donnees <- data.frame(age=sample(0:80,100,replace=TRUE), sexe=sample(c("H","F"),100,replace=TRUE))
p <- pyramide_ages(donnees, "age", "sexe")
exporter_graphique(p, file.path(tempdir(), "pyramide.png"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.