Les posteurs les plus actifs de la semaine
Aucun utilisateur |
Sujets les plus vus
creer une carte
2 participants
Page 1 sur 1
creer une carte
je veux creer une carte de mon pays avec R. et les subdiviser en region pour faire apparaitre les production sous forme d'histogramme dans chaque region. le pays c'est la côte-d-ivoire.
rstat- Nombre de messages : 2
Age : 40
Localisation : Côte-d'ivoire, Abidjan
Date d'inscription : 25/02/2010
Re: creer une carte
Il existe déjà plusieurs package avec des carto pré programmés ; en tout cas j'en ai trouvé pour la France.
Voici comment je procede : (Si biensur tu arrives a trouver ton fond géographique....MAIS si tu poses la question c'est qu'il ne doit malheaureusement pas exister)
test<-function(u){require(maps)
data(franceMapEnv)
groupe<-rep("blue1",times=114)
codeDept<-c(
"59","62","80","59","8","76","2","60","50","55","54","57","27","14","51","95","78","77",
"67","93","61","92","28","75","22","94","22","91","29","29","11","35","52","53","88","72",
"29","89","45","68","56","41","21","70","44","49","90","37","56","18","58","25","56","56",
"56","29","36","86","71","79","85","85","3","85","1","74","23","87","17","69","63","17",
"42","16","17","73","38","19","24","33","15","43","26","7","5","46","48","12","47","4" ,
"40","30","84","82","6","84","81","32","34","13","31","83","65","64","11","64","9","64",
"83","83","83","2B","66","2A")
groupe[codeDept %in% u)]<-"green2"
toto<-map('france', fill = TRUE, col = groupe)
title(paste(u))
}
test(c("41","21","70"))
Voici comment je procede : (Si biensur tu arrives a trouver ton fond géographique....MAIS si tu poses la question c'est qu'il ne doit malheaureusement pas exister)
test<-function(u){require(maps)
data(franceMapEnv)
groupe<-rep("blue1",times=114)
codeDept<-c(
"59","62","80","59","8","76","2","60","50","55","54","57","27","14","51","95","78","77",
"67","93","61","92","28","75","22","94","22","91","29","29","11","35","52","53","88","72",
"29","89","45","68","56","41","21","70","44","49","90","37","56","18","58","25","56","56",
"56","29","36","86","71","79","85","85","3","85","1","74","23","87","17","69","63","17",
"42","16","17","73","38","19","24","33","15","43","26","7","5","46","48","12","47","4" ,
"40","30","84","82","6","84","81","32","34","13","31","83","65","64","11","64","9","64",
"83","83","83","2B","66","2A")
groupe[codeDept %in% u)]<-"green2"
toto<-map('france', fill = TRUE, col = groupe)
title(paste(u))
}
test(c("41","21","70"))
Rico- Nombre de messages : 13
Date d'inscription : 06/11/2007
Sujets similaires
» carte P
» Créer un répertoire
» Créer une fonction R
» Statistique jeu de carte TAROT à 5
» Carte de contrôle avec un taux
» Créer un répertoire
» Créer une fonction R
» Statistique jeu de carte TAROT à 5
» Carte de contrôle avec un taux
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum