| carte_joindre | R Documentation |
Joint un objet sf avec un data.frame statistique. Normalise automatiquement les cles pour eviter les erreurs de correspondance dues aux accents, casses et espaces.
carte_joindre(
sf_obj,
data,
cle_geo,
cle_data = NULL,
type = c("gauche", "interne"),
normaliser = TRUE
)
sf_obj |
sf – Objet geographique (depuis |
data |
data.frame – Donnees statistiques |
cle_geo |
character – Variable cle dans |
cle_data |
character – Variable cle dans |
type |
character – |
normaliser |
logical – Normaliser les cles (recommande). Defaut : TRUE |
Un objet sf enrichi
# Avec les fonds de cartes integres
rca <- carte_zones("rca")
stats <- data.frame(
prefecture = rca$prefecture,
taux_pauvrete = c(74.2, 71.8, 68.5, 65.3, 72.1,
55.4, 48.7, 51.2, 62.3, 58.9,
28.4, 42.1, 52.8, 63.7, 59.4,
44.6, 70.5)[seq_len(nrow(rca))]
)
sf_enrichi <- carte_joindre(rca, stats,
cle_geo = "prefecture",
cle_data = "prefecture")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.