Sommaire
xix
5.2.1
Les fonctions plot() et points() . . . . . . . . . .
168
5.2.2
Les fonctions segments(), lines() et abline() . .
170
5.2.3
La fonction arrows() . . . . . . . . . . . . . . . . .
172
5.2.4
La fonction polygon() . . . . . . . . . . . . . . . .
173
5.2.5
La fonction curve() . . . . . . . . . . . . . . . . . .
173
5.2.6
La fonction box() . . . . . . . . . . . . . . . . . . .
174
5.3
La gestion des couleurs . . . . . . . . . . . . . . . . . . . .
175
5.3.1
La fonction colors() . . . . . . . . . . . . . . . . .
175
5.3.2
Le codage hexad´ ecimal des couleurs . . . . . . . . .
176
5.3.3
La fonction image() . . . . . . . . . . . . . . . . . .
179
5.4
L’ajout de texte . . . . . . . . . . . . . . . . . . . . . . . .
181
5.4.1
La fonction text() . . . . . . . . . . . . . . . . . .
181
5.4.2
La fonction mtext() . . . . . . . . . . . . . . . . . .
182
5.5
Titres, axes et l´ egendes . . . . . . . . . . . . . . . . . . . .
183
5.5.1
La fonction title() . . . . . . . . . . . . . . . . . .
183
5.5.2
La fonction axis() . . . . . . . . . . . . . . . . . .
185
5.5.3
La fonction legend() . . . . . . . . . . . . . . . . .
186
5.6
L’interaction avec le graphique . . . . . . . . . . . . . . . .
187
5.6.1
La fonction locator() . . . . . . . . . . . . . . . .
187
5.6.2
La fonction identify() . . . . . . . . . . . . . . . .
188
5.7 † La gestion fine des param` etres graphiques : par() . . . . .
188
5.8 † Graphiques avanc´ es : rgl, lattice et ggplot2 . . . . . . .
200
Termes ` a retenir . . . . . . . . . . . . . . . . . . . . . . . . . . . .
202
Exercices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
202
Fiche de TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
204
6
Programmation en R
209
6.1
Pr´ eambule . . . . . . . . . . . . . . . . . . . . . . . . . . .
209
6.2
D´ evelopper des fonctions . . . . . . . . . . . . . . . . . . .
210
6.2.1
Mise en route rapide : d´ eclaration, cr´ eation et appel
de fonctions . . . . . . . . . . . . . . . . . . . . . . . .
210
6.2.2
Concepts de base sur les fonctions . . . . . . . . . .
211
6.2.2.1
Corps de fonction . . . . . . . . . . . . . .
211
6.2.2.2
Liste de param` etres formels et effectifs . .
211
6.2.2.3
Objet retourn´ e par une fonction . . . . . .
215
6.2.2.4
Port´ ee des variables dans le corps de la fonction . . . . . . . . . . . . . . . . . . . . . . .
217
6.2.3
Application `
a la probl´ ematique . . . . . . . . . . . .
219
6.2.4
Op´ erateurs . . . . . . . . . . . . . . . . . . . . . . .
220
6.2.5
Le R vu comme un langage fonctionnel . . . . . . .
222
6.3 † Programmation orient´ ee objets . . . . . . . . . . . . . . . .
223
6.3.1
Comment fonctionne le m´ ecanisme orient´ e objet du R 223
6.3.1.1
Classe d’un objet et d´ eclaration d’un objet
223
Précédent

- 19/701

Suivant