-
Notifications
You must be signed in to change notification settings - Fork 42
/
annotations-mathematiques.html
773 lines (677 loc) · 36.2 KB
/
annotations-mathematiques.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
<!DOCTYPE html>
<html lang="fr" xml:lang="fr">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<title>Annotations mathématiques</title>
<script src="libs/header-attrs-2.25/header-attrs.js"></script>
<script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="libs/bootstrap-3.3.5/css/paper.min.css" rel="stylesheet" />
<script src="libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="libs/navigation-1.1/tabsets.js"></script>
<link href="libs/pagedtable-1.1/css/pagedtable.css" rel="stylesheet" />
<script src="libs/pagedtable-1.1/js/pagedtable.js"></script>
<link href="libs/anchor-sections-1.1.0/anchor-sections.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections-hash.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.1.0/anchor-sections.js"></script>
<meta name="robots" content="index, follow">
<link rel="stylesheet" href="./include/analyse-R.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js"></script>
<script type="text/javascript" src="./libs/bigfoot-2.1.4/bigfoot.min.js"></script>
<link rel="stylesheet" href="./libs/bigfoot-2.1.4/bigfoot-number.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<link rel="stylesheet" href="./libs/colorbox-1.6.1/colorbox.css" />
<script type="text/javascript" src="./libs/colorbox-1.6.1/jquery.colorbox-min.js"></script>
<!--- favicon --->
<link rel="apple-touch-icon" sizes="57x57" href="./images/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="./images/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="./images/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="./images/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="./images/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="./images/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="./images/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="./images/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="./images/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="./images/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="./images/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="./images/favicon/favicon-16x16.png">
<link rel="manifest" href="./images/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="./images/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-86STMQ5JPT"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-86STMQ5JPT');
</script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
var j = 0;
while (j < rules.length) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") {
j++;
continue;
}
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') {
j++;
continue;
}
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
details > summary > p:only-child {
display: inline;
}
pre code {
padding: 0;
}
</style>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "\e259";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "\e258";
font-family: 'Glyphicons Halflings';
border: none;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
</head>
<body>
<div class="container-fluid main-container">
<nav>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href=".">analyse-R</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="manipuler" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Manipuler <span class="caret"></span></a>
<ul class="dropdown-menu multi-column columns-3" role="menu" id="menu_manipuler">
<div class="row">
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Prise en main</li>
<li><a href="presentation-et-philosophie.html">Présentation et Philosophie</a></li>
<li><a href="installation-de-R-et-RStudio.html">Installation de <strong>R</strong> et <strong>RStudio</strong></a></li>
<li><a href="premier-contact.html">Premier contact</a></li>
<li><a href="premier-travail-avec-les-donnees.html">Premier travail avec des données</a></li>
<li><a href="extensions.html">Extensions (installation, mise à jour)</a></li>
<li><a href="introduction-au-tidyverse.html">Introduction au <strong>tidyverse</strong></a></li>
<li><a href="vecteurs-indexation-et-assignation.html">Vecteurs, indexation et assignation</a></li>
<li><a href="listes-et-tableaux-de-donnees.html">Listes et Tableaux de données</a></li>
<li><a href="facteurs-et-vecteurs-labellises.html">Facteurs et vecteurs labellisés</a></li>
<li><a href="organiser-ses-fichiers.html">Organiser ses fichiers</a></li>
<li><a href="import-de-donnees.html">Import de données</a></li>
<li><a href="ou-trouver-de-l-aide.html">Où trouver de l'aide ?</a></li>
</ul>
</div>
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Manipulation de données</li>
<li><a href="visualiser-ses-donnees.html">Visualiser ses données</a></li>
<li><a href="recodage.html">Recodage de variables</a></li>
<li><a href="manipuler-les-donnees-avec-dplyr.html">Manipuler les données avec <strong>dplyr</strong></a></li>
<li><a href="manipulations-avancees-avec-data-table.html">Manipulations avancées avec <strong>data.table</strong></a></li>
<li><a href="tris.html">Tris</a></li>
<li><a href="sous-ensembles.html">Sous-ensembles</a></li>
<li><a href="fusion-de-tables.html">Fusion de tables</a></li>
<li><a href="gestion-des-dates.html">Gestion des dates</a></li>
<li><a href="fonctions-a-fenetre.html">Fonctions à fenêtre</a></li>
<li><a href="manipuler-du-texte.html">Manipuler du texte avec <strong>stringr</strong></a></li>
<li><a href="reorganiser-ses-donnees-avec-tidyr.html">Réorganiser ses données avec <strong>tidyr</strong></a></li>
<!--<li><a href="scraping.html.old">Scraping</a></li>-->
</ul>
</div>
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Exporter</li>
<li><a href="export-de-donnees.html">Export de données</a></li>
<li><a href="export-de-graphiques.html">Export de graphiques</a></li>
</ul>
</div>
</div>
</ul>
</li>
<li class="dropdown">
<a href="analyser" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Analyser <span class="caret"></span></a>
<ul class="dropdown-menu multi-column columns-3" role="menu" id="menu_analyser">
<div class="row">
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Statistiques introductives</li>
<li><a href="statistique-univariee.html">Statistique univariée</a></li>
<li><a href="statistique-bivariee.html">Statistique bivariée</a></li>
<li><a href="intro-ggplot2.html">Introduction à <strong>ggplot2</strong>, la grammaire des graphiques</a></li>
<li><a href="graphiques-bivaries-ggplot2.html">Graphiques univariés et bivariés avec <strong>ggplot2</strong></a></li>
<li><a href="donnees-ponderees.html">Données pondérées</a></li>
</ul>
</div>
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Statistiques intermédiaires</li>
<li><a href="intervalles-de-confiance.html">Intervalles de confiance</a></li>
<li><a href="comparaisons-moyennes-et-proportions.html">Comparaisons (moyennes et proportions)</a></li>
<li><a href="definir-un-plan-d-echantillonnage-complexe.html">Définir un plan d'échantillonnage complexe avec <strong>survey</strong></a></li>
<li><a href="regression-lineaire.html">Régression linéaire</a></li>
<li><a href="regression-logistique.html">Régression logistique binaire, multinomiale et ordinale</a></li>
<li><a href="analyse-des-correspondances-multiples.html">Analyse des correspondances multiples (ACM)</a></li>
<li><a href="classification-ascendante-hierarchique.html">Classification ascendante hiérarchique (CAH)</a></li>
</ul>
</div>
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Statistiques avancées</li>
<li><a href="gtsummary.html">Tableaux statistiques avancés avec <strong>gtsummary</strong></a></li>
<li><a href="effets-d-interaction.html">Effets d'interaction dans un modèle</a></li>
<li><a href="multicolinearite.html">Multicolinéarité dans la régression</a></li>
<li><a href="modeles.html">Quel type de modèles choisir ?</a></li>
<li><a href="analyse-de-survie.html">Analyse de survie</a></li>
<li><a href="analyse-de-sequences.html">Analyse de séquences</a></li>
<!--<li><a href="modeles-a-effets-aleatoires.html">Modèles à effets aléatoires (modèles mixtes et GEE)</a></li>-->
<li><a href="trajectoires-de-soins.html">Trajectoires de soins : un exemple de données longitudinales</a></li>
<li><a href="analyse-de-reseaux.html">Analyse de réseaux</a></li>
<li><a href="analyse-spatiale.html">Analyse spatiale</a></li>
<li><a href="analyse-textuelle.html">Analyse textuelle</a></li>
</ul>
</div>
</div>
</ul>
</li>
<li class="dropdown">
<a href="approfondir" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Approfondir <span class="caret"></span></a>
<ul class="dropdown-menu multi-column columns-3" role="menu" id="menu_approfondir">
<div class="row">
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Graphiques</li>
<li><a href="ggplot2.html"><strong>ggplot2</strong> et la grammaire des graphiques</a></li>
<li><a href="etendre-ggplot2.html">Étendre <strong>ggplot2</strong></a></li>
<li><a href="combiner-plusieurs-graphiques.html">Combiner plusieurs graphiques</a></li>
<li><a href="exemples-graphiques-avances.html">Exemples de graphiques avancés</a></li>
<li><a href="graphiques-interactifs.html">Graphiques interactifs</a></li>
<li><a href="lattice-graphiques-et-formules.html"><strong>lattice</strong> : graphiques et formules</a></li>
<li><a href="cartes.html">Cartes</a></li>
<li><a href="autres-extensions-graphiques.html">Autres extensions graphiques</a></li>
</ul>
</div>
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Programmation</li>
<li><a href="conditions-et-comparaisons.html">Conditions et comparaisons</a></li>
<li><a href="formules.html">Formules</a></li>
<li><a href="structures-conditionnelles.html">Structures conditionnelles</a></li>
<li><a href="vectorisation.html">Vectorisation (dont <strong>purrr</strong>)</a></li>
<li><a href="expressions-regulieres.html">Expressions régulières</a></li>
<!--<li class="dev"><a href="ecrire-ses-propres-fonctions.html">Écrire ses propres fonctions</a></li>-->
<li><a href="rmarkdown-les-rapports-automatises.html"><strong>R Markdown</strong> : les rapports automatisés</a></li>
</ul>
</div>
<div class="col-sm-4">
<ul class="multi-column-dropdown">
<li class="dropdown-header">Divers</li>
<li><a href="formater-nombres.html">Mettre en forme des nombres avec <strong>scales</strong></a></li>
<li><a href="couleurs.html">Couleurs et Palettes</a></li>
<li><a href="annotations-mathematiques.html">Annotations mathématiques</a></li>
<li><a href="calculer-un-age.html">Calculer un âge</a></li>
<li><a href="diagramme-de-lexis.html">Diagramme de Lexis</a></li>
</ul>
</div>
</div>
</ul>
</li>
<li class="dropdown">
<a href="index" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Index <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" id="menu_naviguer">
<li><a href="index-des-concepts.html">Index des concepts</a></li>
<li><a href="index-des-fonctions.html">Index des fonctions</a></li>
<li><a href="index-des-extensions.html">Index des extensions</a></li>
</ul>
</li>
<li><a href="analyse-R.pdf">PDF</a></li>
<li><a href="https://larmarange.github.io/guide-R/">guide-R</a></li>
<li><a href="https://larmarange.github.io/webin-R/">webin-R</a></li>
<li><a href="https://www.youtube.com/c/webinR"><i class="fa fa-youtube" aria-hidden="true"></i></a></li>
<!--<li><a href="https://github.com/larmarange/analyse-R">GitHub</a></li>-->
</ul>
<form id="rechercher" class="navbar-form navbar-right" role="search" style="padding-top: 5px;" method="get" action="https://duckduckgo.com/">
<div class="form-group">
<input name="q" type="text" class="form-control input-sm" placeholder="Rechercher">
</div>
<button type="submit" class="btn btn-default btn-sm" name="Rechercher">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</button>
</form>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</nav>
<div class="row">
<div class="visible-lg">
<a href="https://github.com/larmarange/analyse-R"><img style="position: absolute; top: 60px; left: 40px; border: 0;" src="images/fork_me.png" alt="Contribuer sur GitHub"></a>
</div>
<div class="col-sm-9" role="main">
<article>
<div id="header">
<h1 class="title toc-ignore">Annotations mathématiques</h1>
</div>
<div id="TOC">
<ul>
<li><a href="#combiner-texte-et-expression" id="toc-combiner-texte-et-expression">Combiner texte et expression</a></li>
<li><a href="#intégrer-une-valeur-calculée-dans-une-expression" id="toc-intégrer-une-valeur-calculée-dans-une-expression">Intégrer une valeur calculée dans une expression</a></li>
<li><a href="#syntaxe-de-plotmath" id="toc-syntaxe-de-plotmath">Syntaxe de plotmath</a></li>
</ul>
</div>
<p>Pour ajouter des annotation mathématiques à un graphique, comme une équation, on aura recours à la fonction <code data-pkg="base">expression</code>. Les expressions qui peuvent être utilisées sont présentées en détail dans l’aide en ligne de <code data-pkg="grDevices">plotmath</code>, visible également sur <a href="http://www.rdocumentation.org/packages/grDevices/functions/plotmath" class="uri">http://www.rdocumentation.org/packages/grDevices/functions/plotmath</a>.</p>
<div id="combiner-texte-et-expression" class="section level2 hasAnchor">
<h2 class="hasAnchor">Combiner texte et expression<a href="#combiner-texte-et-expression" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>On aura recours à la fonction <code data-pkg="base">paste</code> à l’intérieur de l’appel à <code data-pkg="base">expression</code>. Un exemple :</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" tabindex="-1"></a><span class="co"># données aléatoires</span></span>
<span id="cb1-2"><a href="#cb1-2" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="fu">rnorm</span>(<span class="dv">100</span>), <span class="at">y =</span> <span class="fu">rnorm</span>(<span class="dv">100</span>))</span>
<span id="cb1-3"><a href="#cb1-3" tabindex="-1"></a></span>
<span id="cb1-4"><a href="#cb1-4" tabindex="-1"></a><span class="fu">library</span>(ggplot2)</span>
<span id="cb1-5"><a href="#cb1-5" tabindex="-1"></a><span class="fu">ggplot</span>(df) <span class="sc">+</span></span>
<span id="cb1-6"><a href="#cb1-6" tabindex="-1"></a> <span class="fu">aes</span>(<span class="at">x =</span> x, <span class="at">y =</span> y) <span class="sc">+</span></span>
<span id="cb1-7"><a href="#cb1-7" tabindex="-1"></a> <span class="fu">geom_point</span>() <span class="sc">+</span></span>
<span id="cb1-8"><a href="#cb1-8" tabindex="-1"></a> <span class="fu">xlab</span>(<span class="fu">expression</span>(<span class="fu">hat</span>(mu)[<span class="dv">0</span>])) <span class="sc">+</span></span>
<span id="cb1-9"><a href="#cb1-9" tabindex="-1"></a> <span class="fu">ylab</span>(<span class="fu">expression</span>(alpha<span class="sc">^</span>beta)) <span class="sc">+</span></span>
<span id="cb1-10"><a href="#cb1-10" tabindex="-1"></a> <span class="fu">ggtitle</span>(<span class="fu">expression</span>(<span class="fu">paste</span>(<span class="st">"Plot of "</span>, alpha<span class="sc">^</span>beta, <span class="st">" versus "</span>, <span class="fu">hat</span>(mu)[<span class="dv">0</span>])))</span></code></pre></div>
<p><img src="graphs/annotations-mathematiques/unnamed-chunk-1-1.png" width="1050" /></p>
</div>
<div id="intégrer-une-valeur-calculée-dans-une-expression" class="section level2 hasAnchor">
<h2 class="hasAnchor">Intégrer une valeur calculée dans une expression<a href="#intégrer-une-valeur-calculée-dans-une-expression" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>Pour intégrer une valeur pré-calculée, et donc stockée dans un objet R, dans une expression, on aura recours à la fonction <code data-pkg="base">substitute</code>.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" tabindex="-1"></a>x_mean <span class="ot"><-</span> <span class="fl">1.5</span></span>
<span id="cb2-2"><a href="#cb2-2" tabindex="-1"></a>x_sd <span class="ot"><-</span> <span class="fl">1.2</span></span>
<span id="cb2-3"><a href="#cb2-3" tabindex="-1"></a>df <span class="ot"><-</span> <span class="fu">data.frame</span>(<span class="at">x =</span> <span class="fu">rnorm</span>(<span class="dv">100</span>, x_mean, x_sd))</span>
<span id="cb2-4"><a href="#cb2-4" tabindex="-1"></a></span>
<span id="cb2-5"><a href="#cb2-5" tabindex="-1"></a><span class="fu">ggplot</span>(df) <span class="sc">+</span></span>
<span id="cb2-6"><a href="#cb2-6" tabindex="-1"></a> <span class="fu">aes</span>(<span class="at">x =</span> x) <span class="sc">+</span></span>
<span id="cb2-7"><a href="#cb2-7" tabindex="-1"></a> <span class="fu">geom_histogram</span>(<span class="at">binwidth =</span> .<span class="dv">25</span>) <span class="sc">+</span> </span>
<span id="cb2-8"><a href="#cb2-8" tabindex="-1"></a> <span class="fu">ggtitle</span>(</span>
<span id="cb2-9"><a href="#cb2-9" tabindex="-1"></a> <span class="fu">substitute</span>(</span>
<span id="cb2-10"><a href="#cb2-10" tabindex="-1"></a> <span class="fu">paste</span>(X[i], <span class="st">" ~ N("</span>, mu, <span class="st">"="</span>, m, <span class="st">", "</span>, sigma<span class="sc">^</span><span class="dv">2</span>, <span class="st">"="</span>, s2, <span class="st">")"</span>),</span>
<span id="cb2-11"><a href="#cb2-11" tabindex="-1"></a> <span class="fu">list</span>(<span class="at">m =</span> x_mean, <span class="at">s2 =</span> x_sd<span class="sc">^</span><span class="dv">2</span>)</span>
<span id="cb2-12"><a href="#cb2-12" tabindex="-1"></a> )</span>
<span id="cb2-13"><a href="#cb2-13" tabindex="-1"></a> )</span></code></pre></div>
<p><img src="graphs/annotations-mathematiques/unnamed-chunk-2-1.png" width="1050" /></p>
</div>
<div id="syntaxe-de-plotmath" class="section level2 hasAnchor">
<h2 class="hasAnchor">Syntaxe de plotmath<a href="#syntaxe-de-plotmath" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" tabindex="-1"></a><span class="fu">demo</span>(plotmath)</span></code></pre></div>
<p><img src="graphs/annotations-mathematiques/unnamed-chunk-4-1.png" width="1800" /><img src="graphs/annotations-mathematiques/unnamed-chunk-4-2.png" width="1800" /><img src="graphs/annotations-mathematiques/unnamed-chunk-4-3.png" width="1800" /><img src="graphs/annotations-mathematiques/unnamed-chunk-4-4.png" width="1800" /><img src="graphs/annotations-mathematiques/unnamed-chunk-4-5.png" width="1800" /></p>
</div>
</article>
</div>
<div class="col-sm-3" role="complementary">
<nav class="hidden-print hidden-xs" id="nav_sidebar">
</nav>
</div>
</div>
<script>
// manage active state of menu based on current page
$(document).ready(function () {
// active menu
href = window.location.pathname;
href = href.substr(href.lastIndexOf('/') + 1);
if (href=='') href = 'index.html';
$('a[href="' + href + '"]').parent().addClass('active');
$('a[href="' + href + '"]').parent().parents('li').addClass('active');
// élargir la page d'accueil
if (href=='index.html') $('.col-sm-9').attr('class','col-sm-12');
// rechercher
$("#rechercher").submit(function(event) {
$('input[name="q"]').val($('input[name="q"]').val() + ' site:larmarange.github.io/analyse-R');
});
// sidebar
$("#nav_sidebar").append($("#TOC").html());
$("#nav_sidebar ul").addClass("nav nav-stacked");
$("#TOC").addClass("visible-xs-block");
$('body').scrollspy({
target: '#nav_sidebar',
offset: 40
});
// Identifier les <pre> fermant
$('pre').next("*:not(pre)").prev().addClass('last'); // Dernier <pre> de chaque groupe contigu de <pre>
$('pre').parent().each(function (){
$(this).children('pre').last().addClass('last');
}); // Si <pre> est le dernier enfant de son parent
// Ajout liens rdocumentation et tooltip
$("code[data-pkg]").each(function( index ) {
pkg = $(this).attr('data-pkg');
if ($(this).attr('data-rdoc') !== undefined) {
rdocumentation = $(this).attr('data-rdoc');
} else {
rdocumentation = $(this).text();
}
fonction = $(this).text();
//$(this).wrap('<a href="http://www.rdocumentation.org/packages/'+pkg+'/functions/'+rdocumentation+'">');
$(this).wrap('<a href="http://rdrr.io/pkg/'+pkg+'/sym/'+rdocumentation+'">');
$(this).attr('data-toggle','tooltip');
$(this).attr('data-placement','top');
$(this).attr('title','package : ' + pkg);
$('[data-toggle="tooltip"]').tooltip();
});
$("code.pkg").each(function( index ) {
//$(this).wrap('<a href="http://www.rdocumentation.org/packages/'+$(this).text()+'">');
$(this).wrap('<a href="http://rdrr.io/pkg/'+$(this).text()+'">');
});
// Figures
$("figure").each(function( index ) {
if ($(this).children("figcaption").length > 0)
$(this).children("figcaption:first").prepend('<span class="figure-number">Figure '+(index+1)+'.</span> ');
else
$(this).append($("<figcaption>").append('<span class="figure-number">Figure '+(index+1)+'</span>'));
});
// Colorbox
/*----
jQuery('article div img').colorbox({
maxWidth: '90%',
maxHeight: '90%',
rel: 'figures',
current: "",
href: function(){
return $(this).attr('src');
},
title: function(){
return $(this).attr('alt');
}
});
jQuery('article div img').css('cursor', 'pointer');
jQuery('figure img').colorbox({
maxWidth: '90%',
maxHeight: '90%',
rel: 'figures',
current: "",
href: function(){
return $(this).attr('src');
},
title: function(){
return $(this).parent().children("figcaption").text();
}
});
jQuery('figure img').css('cursor', 'pointer');
-----*/
/* Clipboard --------------------------*/
function changeTooltipMessage(element, msg) {
var tooltipOriginalTitle=element.getAttribute('data-original-title');
element.setAttribute('data-original-title', msg);
$(element).tooltip('show');
element.setAttribute('data-original-title', tooltipOriginalTitle);
}
if(ClipboardJS.isSupported()) {
$(document).ready(function() {
var copyButton = "<button type='button' class='btn btn-primary btn-copy-ex' type = 'submit' title='Copier dans le presse-papier' aria-label='Copier dans le presse-papier' data-toggle='tooltip' data-placement='left auto' data-trigger='hover' data-clipboard-copy><i class='fa fa-copy'></i></button>";
$(".examples, div.sourceCode").addClass("hasCopyButton");
// Insert copy buttons:
$(copyButton).prependTo(".hasCopyButton");
// Initialize tooltips:
$('.btn-copy-ex').tooltip({container: 'body'});
// Initialize clipboard:
var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {
text: function(trigger) {
return trigger.parentNode.textContent;
}
});
clipboardBtnCopies.on('success', function(e) {
changeTooltipMessage(e.trigger, 'Copié !');
e.clearSelection();
});
clipboardBtnCopies.on('error', function() {
changeTooltipMessage(e.trigger,'Appuyez sur Ctrl+C ou Command+C pour copier');
});
});
}
// Bigfoot
$(".footnotes > li").addClass("footnote");
$.bigfoot({
activateOnHover: true,
actionOriginalFN: "ignore"
});
});
</script>
<!-- Utterances comments
<script src="https://utteranc.es/client.js"
repo="larmarange/analyse-R"
issue-term="pathname"
label="commentaires"
theme="github-light"
crossorigin="anonymous"
async>
</script>
-->
<!-- Giscus comments -->
<script src="https://giscus.app/client.js"
data-repo="larmarange/analyse-R"
data-repo-id="MDEwOlJlcG9zaXRvcnkzNDk4NjY2Ng=="
data-category-id="DIC_kwDOAhXaqs4B_iH_"
data-mapping="pathname"
data-reactions-enabled="1"
data-emit-metadata="0"
data-theme="light"
data-lang="fr"
crossorigin="anonymous"
async>
</script>
<!-- disqus -->
<!---
<div class="row">
<div id="disqus_thread" class="col-sm-9" role="complementary"></div>
</div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'analyse-r'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Veuillez activer JavaScript pour voir les <a href="http://disqus.com/?ref_noscript">les commentaires gérés avec Disqus.</a></noscript>
<!--<a href="http://disqus.com" class="dsq-brlink">Les commentaires sont hébergés par <span class="logo-disqus">Disqus</span>.</a>-->
<footer>
<div class="row">
<div class="col-lg-12">
<p>Contenus sous licence <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/fr/" rel="nofollow">Creative Commons Attribution - Pas d’utilisation commerciale - Partage dans les mêmes conditions</a>.<br />
Propulsé par <a href="http://www.r-project.org/" rel="nofollow">R</a>, </a><a href="http://www.rstudio.com/" rel="nofollow">RStudio</a>, <a href="http://rmarkdown.rstudio.com/" rel="nofollow">R Markdown</a>, <a href="http://yihui.name/knitr/" rel="nofollow">knitr</a>, <a href="http://pandoc.org/" rel="nofollow">pandoc</a> et <a href="http://www.princexml.com/" rel="nofollow">Prince XML</a>. Hébergé par <a href="https://github.com/" rel="nofollow">GitHub</a>.<br />
<a href="https://www.zenodo.org/badge/latestdoi/34986666"><img src="https://www.zenodo.org/badge/34986666.svg" alt="DOI"></a></p>
</div>
</div>
</footer>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open');
});
});
</script>
<!-- code folding -->
</body>
</html>