-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
5494 lines (5347 loc) · 306 KB
/
index.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
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en"><head>
<script src="index_files/libs/clipboard/clipboard.min.js"></script>
<script src="index_files/libs/quarto-html/tabby.min.js"></script>
<script src="index_files/libs/quarto-html/popper.min.js"></script>
<script src="index_files/libs/quarto-html/tippy.umd.min.js"></script>
<link href="index_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="index_files/libs/quarto-html/quarto-html.min.css" rel="stylesheet" data-mode="light">
<link href="index_files/libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.0.36">
<title>index</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="index_files/libs/revealjs/dist/reset.css">
<link rel="stylesheet" href="index_files/libs/revealjs/dist/reveal.css">
<style>
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;}
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: #767676;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #767676; padding-left: 4px; }
div.sourceCode
{ color: #545454; background-color: #fefefe; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span { color: #545454; } /* Normal */
code span.al { color: #7928a1; } /* Alert */
code span.an { color: #696969; } /* Annotation */
code span.at { color: #aa5d00; } /* Attribute */
code span.bn { color: #7928a1; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #d91e18; } /* ControlFlow */
code span.ch { color: #008000; } /* Char */
code span.cn { color: #d91e18; } /* Constant */
code span.co { color: #696969; } /* Comment */
code span.cv { color: #696969; font-style: italic; } /* CommentVar */
code span.do { color: #696969; font-style: italic; } /* Documentation */
code span.dt { color: #7928a1; } /* DataType */
code span.dv { color: #7928a1; } /* DecVal */
code span.er { color: #7928a1; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #aa5d00; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #696969; } /* Information */
code span.kw { color: #d91e18; } /* Keyword */
code span.op { color: #007faa; } /* Operator */
code span.ot { color: #d91e18; } /* Other */
code span.pp { color: #7928a1; } /* Preprocessor */
code span.sc { color: #007faa; } /* SpecialChar */
code span.ss { color: #008000; } /* SpecialString */
code span.st { color: #008000; } /* String */
code span.va { color: #aa5d00; } /* Variable */
code span.vs { color: #008000; } /* VerbatimString */
code span.wa { color: #696969; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="index_files/libs/revealjs/dist/theme/quarto.css" id="theme">
<link href="index_files/libs/revealjs/plugin/quarto-line-highlight/line-highlight.css" rel="stylesheet">
<link href="index_files/libs/revealjs/plugin/reveal-menu/menu.css" rel="stylesheet">
<link href="index_files/libs/revealjs/plugin/reveal-menu/quarto-menu.css" rel="stylesheet">
<link href="index_files/libs/revealjs/plugin/reveal-chalkboard/font-awesome/css/all.css" rel="stylesheet">
<link href="index_files/libs/revealjs/plugin/reveal-chalkboard/style.css" rel="stylesheet">
<link href="index_files/libs/revealjs/plugin/quarto-support/footer.css" rel="stylesheet">
<style type="text/css">
.callout {
margin-top: 1em;
margin-bottom: 1em;
border-radius: .25rem;
}
.callout.callout-style-simple {
padding: 0em 0.5em;
border-left: solid #acacac .3rem;
border-right: solid 1px silver;
border-top: solid 1px silver;
border-bottom: solid 1px silver;
display: flex;
}
.callout.callout-style-default {
border-left: solid #acacac .3rem;
border-right: solid 1px silver;
border-top: solid 1px silver;
border-bottom: solid 1px silver;
}
.callout .callout-body-container {
flex-grow: 1;
}
.callout.callout-style-simple .callout-body {
font-size: 1rem;
font-weight: 400;
}
.callout.callout-style-default .callout-body {
font-size: 0.9rem;
font-weight: 400;
}
.callout.callout-captioned.callout-style-simple .callout-body {
margin-top: 0.2em;
}
.callout:not(.callout-captioned) .callout-body {
display: flex;
}
.callout:not(.no-icon).callout-captioned.callout-style-simple .callout-content {
padding-left: 1.6em;
}
.callout.callout-captioned .callout-header {
padding-top: 0.2em;
margin-bottom: -0.2em;
}
.callout.callout-captioned .callout-caption p {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.callout.callout-captioned.callout-style-simple .callout-content p {
margin-top: 0;
}
.callout.callout-captioned.callout-style-default .callout-content p {
margin-top: 0.7em;
}
.callout.callout-style-simple div.callout-caption {
border-bottom: none;
font-size: .9rem;
font-weight: 600;
opacity: 75%;
}
.callout.callout-style-default div.callout-caption {
border-bottom: none;
font-weight: 600;
opacity: 85%;
font-size: 0.9rem;
padding-left: 0.5em;
padding-right: 0.5em;
}
.callout.callout-style-default div.callout-content {
padding-left: 0.5em;
padding-right: 0.5em;
}
.callout.callout-style-simple .callout-icon::before {
height: 1rem;
width: 1rem;
display: inline-block;
content: "";
background-repeat: no-repeat;
background-size: 1rem 1rem;
}
.callout.callout-style-default .callout-icon::before {
height: 0.9rem;
width: 0.9rem;
display: inline-block;
content: "";
background-repeat: no-repeat;
background-size: 0.9rem 0.9rem;
}
.callout-caption {
display: flex
}
.callout-icon::before {
margin-top: 1rem;
padding-right: .5rem;
}
.callout.no-icon::before {
display: none !important;
}
.callout.callout-captioned .callout-body > .callout-content > :last-child {
margin-bottom: 0.5rem;
}
.callout.callout-captioned .callout-icon::before {
margin-top: .5rem;
padding-right: .5rem;
}
.callout:not(.callout-captioned) .callout-icon::before {
margin-top: 1rem;
padding-right: .5rem;
}
/* Callout Types */
div.callout-note {
border-left-color: #4582ec !important;
}
div.callout-note .callout-icon::before {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAAEU0lEQVRYCcVXTWhcVRQ+586kSUMMxkyaElstCto2SIhitS5Ek8xUKV2poatCcVHtUlFQk8mbaaziwpWgglJwVaquitBOfhQXFlqlzSJpFSpIYyXNjBNiTCck7x2/8/LeNDOZxDuEkgOXe++553zfefee+/OYLOXFk3+1LLrRdiO81yNqZ6K9cG0P3MeFaMIQjXssE8Z1JzLO9ls20MBZX7oG8w9GxB0goaPrW5aNMp1yOZIa7Wv6o2ykpLtmAPs/vrG14Z+6d4jpbSKuhdcSyq9wGMPXjonwmESXrriLzFGOdDBLB8Y6MNYBu0dRokSygMA/mrun8MGFN3behm6VVAwg4WR3i6FvYK1T7MHo9BK7ydH+1uurECoouk5MPRyVSBrBHMYwVobG2aOXM07sWrn5qgB60rc6mcwIDJtQrnrEr44kmy+UO9r0u9O5/YbkS9juQckLed3DyW2XV/qWBBB3ptvI8EUY3I9p/67OW+g967TNr3Sotn3IuVlfMLVnsBwH4fsnebJvyGm5GeIUA3jljERmrv49SizPYuq+z7c2H/jlGC+Ghhupn/hcapqmcudB9jwJ/3jvnvu6vu5lVzF1fXyZuZZ7U8nRmVzytvT+H3kilYvH09mLWrQdwFSsFEsxFVs5fK7A0g8gMZjbif4ACpKbjv7gNGaD8bUrlk8x+KRflttr22JEMRUbTUwwDQScyzPgedQHZT0xnx7ujw2jfVfExwYHwOsDTjLdJ2ebmeQIlJ7neo41s/DrsL3kl+W2lWvAga0tR3zueGr6GL78M3ifH0rGXrBC2aAR8uYcIA5gwV8zIE8onoh8u0Fca/ciF7j1uOzEnqcIm59sEXoGc0+z6+H45V1CvAvHcD7THztu669cnp+L0okAeIc6zjbM/24LgGM1gZk7jnRu1aQWoU9sfUOuhrmtaPIO3YY1KLLWZaEO5TKUbMY5zx8W9UJ6elpLwKXbsaZ4EFl7B4bMtDv0iRipKoDQT2sNQI9b1utXFdYisi+wzZ/ri/1m7QfDgEuvgUUEIJPq3DhX/5DWNqIXDOweC2wvIR90Oq3lDpdMIgD2r0dXvGdsEW5H6x6HLRJYU7C69VefO1x8Gde1ZFSJLfWS1jbCnhtOPxmpfv2LXOA2Xk2tvnwKKPFuZ/oRmwBwqRQDcKNeVQkYcOjtWVBuM/JuYw5b6isojIkYxyYAFn5K7ZBF10fea52y8QltAg6jnMqNHFBmGkQ1j+U43HMi2xMar1Nv0zGsf1s8nUsmUtPOOrbFIR8bHFDMB5zL13Gmr/kGlCkUzedTzzmzsaJXhYawnA3UmARpiYj5ooJZiUoxFRtK3X6pgNPv+IZVPcnwbOl6f+aBaO1CNvPW9n9LmCp01nuSaTRF2YxHqZ8DYQT6WsXT+RD6eUztwYLZ8rM+rcPxamv1VQzFUkzFXvkiVrySGQgJNvXHJAxiU3/NwiC03rSf05VBaPtu/Z7/B8Yn/w7eguloAAAAAElFTkSuQmCC');
}
div.callout-note.callout-style-default .callout-caption {
background-color: #dae6fb
}
div.callout-important {
border-left-color: #d9534f !important;
}
div.callout-important .callout-icon::before {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAAEKklEQVRYCcVXTWhcVRS+575MJym48A+hSRFr00ySRQhURRfd2HYjk2SSTokuBCkU2o0LoSKKraKIBTcuFCoidGFD08nkBzdREbpQ1EDNIv8qSGMFUboImMSZd4/f9zJv8ibJMC8xJQfO3HPPPef7zrvvvnvviIkpC9nsw0UttFunbUhpFzFtarSd6WJkStVMw5xyVqYTvkwfzuf/5FgtkVoB0729j1rjXwThS7Vio+Mo6DNnvLfahoZ+i/o32lULuJ3NNiz7q6+pyAUkJaFF6JwaM2lUJlV0MlnQn5aTRbEu0SEqHUa0A4AdiGuB1kFXRfVyg5d87+Dg4DL6m2TLAub60ilj7A1Ec4odSAc8X95sHh7+ZRPCFo6Fnp7HfU/fBng/hi10CjCnWnJjsxvDNxWw0NfV6Rv5GgP3I3jGWXumdTD/3cbEOP2ZbOZp69yniG3FQ9z1jD7bnBu9Fc2tKGC2q+uAJOQHBDRiZX1x36o7fWBs7J9ownbtO+n0/qWkvW7UPIfc37WgT6ZGR++EOJyeQDSb9UB+DZ1G6DdLDzyS+b/kBCYGsYgJbSQHuThGKRcw5xdeQf8YdNHsc6ePXrlSYMBuSIAFTGAtQo+VuALo4BX83N190NWZWbynBjhOHsmNfFWLeL6v+ynsA58zDvvAC8j5PkbOcXCMg2PZFk3q8MjI7WAG/Dp9AwP7jdGBOOQkAvlFUB+irtm16I1Zw9YBcpGTGXYmk3kQIC/Cds55l+iMI3jqhjAuaoe+am2Jw5GT3Nbz3CkE12NavmzN5+erJW7046n/CH1RO/RVa8lBLozXk9uqykkGAyRXLWlLv5jyp4RFsG5vGVzpDLnIjTWgnRy2Rr+tDKvRc7Y8AyZq10jj8DqXdnIRNtFZb+t/ZRtXcDiVnzpqx8mPcDWxgARUqx0W1QB9MeUZiNrV4qP+Ehc+BpNgATsTX8ozYKL2NtFYAHc84fG7ndxUPr+AR/iQSns7uSUufAymwDOb2+NjK27lEFocm/EE2WpyIy/Hi66MWuMKJn8RvxIcj87IM5Vh9663ziW36kR0HNenXuxmfaD8JC7tfKbrhFr7LiZCrMjrzTeGx+PmkosrkNzW94ObzwocJ7A1HokLolY+AvkTiD/q1H0cN48c5EL8Crkttsa/AXQVDmutfyku0E7jShx49XqV3MFK8IryDhYVbj7Sj2P2eBxwcXoe8T8idsKKPRcnZw1b+slFTubwUwhktrfnAt7J++jwQtLZcm3sr9LQrjRzz6cfMv9aLvgmnAGvpoaGLxM4mAEaLV7iAzQ3oU0IvD5x9ix3yF2RAAuYAOO2f7PEFWCXZ4C9Pb2UsgDeVnFSpbFK7/IWu7TPTvBqzbGdCHOJQSxiEjt6IyZmxQyEJHv6xyQsYk//moVFsN2zP6fRImjfq7/n/wFDguUQFNEwugAAAABJRU5ErkJggg==');
}
div.callout-important.callout-style-default .callout-caption {
background-color: #f7dddc
}
div.callout-warning {
border-left-color: #f0ad4e !important;
}
div.callout-warning .callout-icon::before {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAAETklEQVRYCeVWW2gcVRg+58yaTUnizqbipZeX4uWhBEniBaoUX1Ioze52t7sRq6APio9V9MEaoWlVsFasRq0gltaAPuxms8lu0gcviE/FFOstVbSIxgcv6SU7EZqmdc7v9+9mJtNks51NTUH84ed889/PP+cmxP+d5FIbMJmNbpREu4WUkiTtCicKny0l1pIKmBzovF2S+hIJHX8iEu3hZJ5lNZGqyRrGSIQpq15AzF28jgpeY6yk6GVdrfFqdrD6Iw+QlB8g0YS2g7dyQmXM/IDhBhT0UCiRf59lfqmmDvzRt6kByV/m4JjtzuaujMUM2c5Z2d6JdKrRb3K2q6mA+oYVz8JnDdKPmmNthzkAk/lN63sYPgevrguc72aZX/L9C6x09GYyxBgCX4NlvyGUHOKELlm5rXeR1kchuChJt4SSwyddZRXgvwMGvYo4QSlk3/zkHD8UHxwVJA6zjZZqP8v8kK8OWLnIZtLyCAJagYC4rTGW/9Pqj92N/c+LUaAj27movwbi19tk/whRCIE7Q9vyI6yvRpftAKVTdUjOW40X3h5OXsKCdmFcx0xlLJoSuQngnrJe7Kcjm4OMq9FlC7CMmScQANuNvjfP3PjGXDBaUQmbp296S5L4DrpbrHN1T87ZVEZVCzg1FF0Ft+dKrlLukI+/c9ENo+TvlTDbYFvuKPtQ9+l052rXrgKoWkDAFnvh0wTOmYn8R5f4k/jN/fZiCM1tQx9jQQ4ANhqG4hiL0qIFTGViG9DKB7GYzgubnpofgYRwO+DFjh0Zin2m4b/97EDkXkc+f6xYAPX0KK2I/7fUQuwzuwo/L3AkcjugPNixC8cHf0FyPjWlItmLxWw4Ou9YsQCr5fijMGoD/zpdRy95HRysyXA74MWOnscpO4j2y3HAVisw85hX5+AFBRSHt4ShfLFkIMXTqyKFc46xdzQM6XbAi702a7sy04J0+feReMFKp5q9esYLCqAZYw/k14E/xcLLsFElaornTuJB0svMuJINy8xkIYuL+xPAlWRceH6+HX7THJ0djLUom46zREu7tTkxwmf/FdOZ/sh6Q8qvEAiHpm4PJ4a/doJe0gH1t+aHRgCzOvBvJedEK5OFE5jpm4AGP2a8Dxe3gGJ/pAutug9Gp6he92CsSsWBaEcxGx0FHytmIpuqGkOpldqNYQK8cSoXvd+xLxXADw0kf6UkJNFtdo5MOgaLjiQOQHcn+A6h5NuL2s0qsC2LOM75PcF3yr5STuBSAcGG+meA14K/CI21HcS4LBT6tv0QAh8Dr5l93AhZzG5ZJ4VxAqdZUEl9z7WJ4aN+svMvwHHL21UKTd1mqvChH7/Za5xzXBBKrUcB0TQ+Ulgkfbi/H/YT5EptrGzsEK7tR1B7ln9BBwckYfMiuSqklSznIuoIIOM42MQO+QnduCoFCI0bpkzjCjddHPN/F+2Yu+sd9bKNpVwHhbS3LluK/0zgfwD0xYI5dXuzlQAAAABJRU5ErkJggg==');
}
div.callout-warning.callout-style-default .callout-caption {
background-color: #fcefdc
}
div.callout-tip {
border-left-color: #02b875 !important;
}
div.callout-tip .callout-icon::before {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAADr0lEQVRYCe1XTWgTQRj9ZjZV8a9SPIkKgj8I1bMHsUWrqYLVg4Ue6v9BwZOxSYsIerFao7UiUryIqJcqgtpimhbBXoSCVxUFe9CTiogUrUp2Pt+3aUI2u5vdNh4dmMzOzHvvezuz8xNFM0mjnbXaNu1MvFWRXkXEyE6aYOYJpdW4IXuA4r0fo8qqSMDBU0v1HJUgVieAXxzCsdE/YJTdFcVIZQNMyhruOMJKXYFoLfIfIvVIMWdsrd+Rpd86ZmyzzjJmLStqRn0v8lzkb4rVIXvnpScOJuAn2ACC65FkPzEdEy4TPWRLJ2h7z4cArXzzaOdKlbOvKKX25Wl00jSnrwVxAg3o4dRxhO13RBSdNvH0xSARv3adTXbBdTf64IWO2vH0LT+cv4GR1DJt+DUItaQogeBX/chhbTBxEiZ6gftlDNXTrvT7co4ub5A6gp9HIcHvzTa46OS5fBeP87Qm0fQkr4FsYgVQ7Qg+ZayaDg9jhg1GkWj8RG6lkeSacrrHgDaxdoBiZPg+NXV/KifMuB6//JmYH4CntVEHy/keA6x4h4CU5oFy8GzrBS18cLJMXcljAKB6INjWsRcuZBWVaS3GDrqB7rdapVIeA+isQ57Eev9eCqzqOa81CY05VLd6SamW2wA2H3SiTbnbSxmzfp7WtKZkqy4mdyAlGx7ennghYf8voqp9cLSgKdqNfa6RdRsAAkPwRuJZNbpByn+RrJi1RXTwdi8RQF6ymDwGMAtZ6TVE+4uoKh+MYkcLsT0Hk8eAienbiGdjJHZTpmNjlbFJNKDVAp2fJlYju6IreQxQ08UJDNYdoLSl6AadO+fFuCQqVMB1NJwPm69T04Wv5WhfcWyfXQB+wXRs1pt+nCknRa0LVzSA/2B+a9+zQJadb7IyyV24YAxKp2Jqs3emZTuNnKxsah+uabKbMk7CbTgJx/zIgQYErIeTKRQ9yD9wxVof5YolPHqaWo7TD6tJlh7jQnK5z2n3+fGdggIOx2kaa2YI9QWarc5Ce1ipNWMKeSG4DysFF52KBmTNMmn5HqCFkwy34rDg05gDwgH3bBi+sgFhN/e8QvRn8kbamCOhgrZ9GJhFDgfcMHzFb6BAtjKpFhzTjwv1KCVuxHvCbsSiEz4CANnj84cwHdFXAbAOJ4LTSAawGWFn5tDhLMYz6nWeU2wJfIhmIJBefcd/A5FWQWGgrWzyORZ3Q6HuV+Jf0Bj+BTX69fm1zWgK7By1YTXchFDORywnfQ7GpzOo6S+qECrsx2ifVQAAAABJRU5ErkJggg==');
}
div.callout-tip.callout-style-default .callout-caption {
background-color: #ccf1e3
}
div.callout-caution {
border-left-color: #fd7e14 !important;
}
div.callout-caution .callout-icon::before {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAACV0lEQVRYCdVWzWoUQRCuqp2ICBLJXgITZL1EfQDBW/bkzUMUD7klD+ATSHBEfAIfQO+iXsWDxJsHL96EHAwhgzlkg8nBg25XWb0zIb0zs9muYYWkoKeru+vn664fBqElyZNuyh167NXJ8Ut8McjbmEraKHkd7uAnAFku+VWdb3reSmRV8PKSLfZ0Gjn3a6Xlcq9YGb6tADjn+lUfTXtVmaZ1KwBIvFI11rRXlWlatwIAAv2asaa9mlB9wwygiDX26qaw1yYPzFXg2N1GgG0FMF8Oj+VIx7E/03lHx8UhvYyNZLN7BwSPgekXXLribw7w5/c8EF+DBK5idvDVYtEEwMeYefjjLAdEyQ3M9nfOkgnPTEkYU+sxMq0BxNR6jExrAI31H1rzvLEfRIdgcv1XEdj6QTQAS2wtstEALLG1yEZ3QhH6oDX7ExBSFEkFINXH98NTrme5IOaaA7kIfiu2L8A3qhH9zRbukdCqdsA98TdElyeMe5BI8Rs2xHRIsoTSSVFfCFCWGPn9XHb4cdobRIWABNf0add9jakDjQJpJ1bTXOJXnnRXHRf+dNL1ZV1MBRCXhMbaHqGI1JkKIL7+i8uffuP6wVQAzO7+qVEbF6NbS0LJureYcWXUUhH66nLR5rYmva+2tjRFtojkM2aD76HEGAD3tPtKM309FJg5j/K682ywcWJ3PASCcycH/22u+Bh7Aa0ehM2Fu4z0SAE81HF9RkB21c5bEn4Dzw+/qNOyXr3DCTQDMBOdhi4nAgiFDGCinIa2owCEChUwD8qzd03PG+qdW/4fDzjUMcE1ZpIAAAAASUVORK5CYII=');
}
div.callout-caution.callout-style-default .callout-caption {
background-color: #ffe5d0
}
</style>
<style type="text/css">
.reveal div.sourceCode {
margin: 0;
overflow: auto;
}
.reveal div.hanging-indent {
margin-left: 1em;
text-indent: -1em;
}
.reveal .slide:not(.center) {
height: 100%;
}
.reveal .slide.scrollable {
overflow-y: auto;
}
.reveal .footnotes {
height: 100%;
overflow-y: auto;
}
.reveal .slide .absolute {
position: absolute;
display: block;
}
.reveal .footnotes ol {
counter-reset: ol;
list-style-type: none;
margin-left: 0;
}
.reveal .footnotes ol li:before {
counter-increment: ol;
content: counter(ol) ". ";
}
.reveal .footnotes ol li > p:first-child {
display: inline-block;
}
.reveal .slide ul,
.reveal .slide ol {
margin-bottom: 0.5em;
}
.reveal .slide ul li,
.reveal .slide ol li {
margin-top: 0.4em;
margin-bottom: 0.2em;
}
.reveal .slide ul[role="tablist"] li {
margin-bottom: 0;
}
.reveal .slide ul li > *:first-child,
.reveal .slide ol li > *:first-child {
margin-block-start: 0;
}
.reveal .slide ul li > *:last-child,
.reveal .slide ol li > *:last-child {
margin-block-end: 0;
}
.reveal .slide .columns:nth-child(3) {
margin-block-start: 0.8em;
}
.reveal blockquote {
box-shadow: none;
}
.reveal .tippy-content>* {
margin-top: 0.2em;
margin-bottom: 0.7em;
}
.reveal .tippy-content>*:last-child {
margin-bottom: 0.2em;
}
.reveal .slide > img.stretch.quarto-figure-center,
.reveal .slide > img.r-stretch.quarto-figure-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.reveal .slide > img.stretch.quarto-figure-left,
.reveal .slide > img.r-stretch.quarto-figure-left {
display: block;
margin-left: 0;
margin-right: auto;
}
.reveal .slide > img.stretch.quarto-figure-right,
.reveal .slide > img.r-stretch.quarto-figure-right {
display: block;
margin-left: auto;
margin-right: 0;
}
</style>
</head>
<body class="quarto-light">
<div class="reveal">
<div class="slides">
<section class="slide level2">
<br> <br> <br> <br> <br>
<h1>
How to plot general scientific figures in <code>R</code>
</h1>
<hr>
<h3>
Li Zhiwei <br>Capital Medical University
</h3>
<h3>
2022-09-19
</h3>
<p><br></p>
<h3>
<p><svg aria-hidden="true" role="img" viewbox="0 0 496 512" style="height:1em;width:0.97em;vertical-align:-0.125em;margin-left:auto;margin-right:auto;font-size:inherit;fill:black;overflow:visible;position:relative;"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> <a href="https://github.com/lizhiwei1994/How-to-plot-in-R">github.com/lizhiwei1994/How-to-plot-in-R</a></p>
<p><svg aria-hidden="true" role="img" viewbox="0 0 576 512" style="height:1em;width:1.12em;vertical-align:-0.125em;margin-left:auto;margin-right:auto;font-size:inherit;fill:black;overflow:visible;position:relative;"><path d="M160 448c-25.6 0-51.2-22.4-64-32-64-44.8-83.2-60.8-96-70.4V480c0 17.67 14.33 32 32 32h256c17.67 0 32-14.33 32-32V345.6c-12.8 9.6-32 25.6-96 70.4-12.8 9.6-38.4 32-64 32zm128-192H32c-17.67 0-32 14.33-32 32v16c25.6 19.2 22.4 19.2 115.2 86.4 9.6 6.4 28.8 25.6 44.8 25.6s35.2-19.2 44.8-22.4c92.8-67.2 89.6-67.2 115.2-86.4V288c0-17.67-14.33-32-32-32zm256-96H224c-17.67 0-32 14.33-32 32v32h96c33.21 0 60.59 25.42 63.71 57.82l.29-.22V416h192c17.67 0 32-14.33 32-32V192c0-17.67-14.33-32-32-32zm-32 128h-64v-64h64v64zm-352-96c0-35.29 28.71-64 64-64h224V32c0-17.67-14.33-32-32-32H96C78.33 0 64 14.33 64 32v192h96v-32z"></path></svg> <a href="[email protected]">[email protected]</a></p>
</h3></section>
<section id="content" class="slide level2">
<h2>Content</h2>
<p><br> <br></p>
<ul>
<li class="fragment">Table 1 <br> <br></li>
<li class="fragment">Forestplot <br> <br></li>
<li class="fragment">A combined plot</li>
</ul>
</section>
<section>
<section id="table-1" class="title-slide slide level1 center">
<h1>Table 1</h1>
</section>
<section id="what-is-table-1" class="slide level2">
<h2>What is <code>Table-1</code>?</h2>
<div class="columns">
<div class="column" style="width:35%;">
<p>It is standard practice in epidemiology and related fields that the first table of any journal article, referred to as “Table 1”, is a table that presents descriptive statistics of <strong>baseline characteristics</strong> of the study population <strong>stratified by exposure</strong>.</p>
</div><div class="column" style="width:31%;">
<p><img data-src="images/paper_table1.png"></p>
</div><div class="column" style="width:31%;">
<p><img data-src="images/paper_table2.png"></p>
</div>
</div>
</section>
<section id="creat-table-1-using-tableone-package" class="slide level2">
<h2>Creat table 1 using <code>tableone</code> package</h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb1" data-code-line-numbers="1|2"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1"></a><span class="fu">library</span>(tableone) <span class="co"># main package</span></span>
<span id="cb1-2"><a href="#cb1-2"></a>dat <span class="ot">=</span> <span class="fu">read.csv</span>(<span class="st">'examples/data/table1_data.csv'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="fragment">
<p><img data-src="images/data_tableone.png"></p>
</div>
</section>
<section id="creat-table-1-using-tableone-package-1" class="slide level2">
<h2>Creat table 1 using <code>tableone</code> package</h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb2" data-code-line-numbers="|1-2|3|4-7|8-9|10"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1"></a>listVars <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"Age"</span>, <span class="st">"Gender"</span>, <span class="st">"Cholesterol"</span>, <span class="st">"SystolicBP"</span>, </span>
<span id="cb2-2"><a href="#cb2-2"></a> <span class="st">"BMI"</span>, <span class="st">"Smoking"</span>, <span class="st">"Education"</span>)</span>
<span id="cb2-3"><a href="#cb2-3"></a>catVars <span class="ot"><-</span> <span class="fu">c</span>(<span class="st">"Smoking"</span>,<span class="st">"Education"</span>)</span>
<span id="cb2-4"><a href="#cb2-4"></a>table1 <span class="ot"><-</span> <span class="fu">CreateTableOne</span>(<span class="at">vars =</span> listVars, </span>
<span id="cb2-5"><a href="#cb2-5"></a> <span class="at">data =</span> dat, </span>
<span id="cb2-6"><a href="#cb2-6"></a> <span class="at">factorVars =</span> catVars, </span>
<span id="cb2-7"><a href="#cb2-7"></a> <span class="at">strata =</span> <span class="fu">c</span>(<span class="st">"Gender"</span>))</span>
<span id="cb2-8"><a href="#cb2-8"></a>a <span class="ot"><-</span> <span class="fu">print</span>(table1, <span class="at">quote =</span> <span class="cn">TRUE</span>, <span class="at">noSpaces =</span> <span class="cn">TRUE</span>)</span>
<span id="cb2-9"><a href="#cb2-9"></a>a <span class="ot"><-</span> <span class="fu">as.data.frame</span>(a)</span>
<span id="cb2-10"><a href="#cb2-10"></a><span class="fu">write.csv</span>(a, <span class="st">'result_tableone.csv'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="fragment">
<p><img data-src="images/result_tableone.png"></p>
</div>
</section>
<section id="creat-table-1-using-arsenal-package" class="slide level2">
<h2>Creat table 1 using <code>arsenal</code> package</h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb3" data-code-line-numbers="1|2-3|4-5"><pre class="sourceCode numberSource r code-overflow-wrap number-lines code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1"></a><span class="fu">library</span>(arsenal)</span>
<span id="cb3-2"><a href="#cb3-2"></a>tab1 <span class="ot"><-</span> <span class="fu">tableby</span>(Gender <span class="sc">~</span> Age <span class="sc">+</span> Cholesterol <span class="sc">+</span> SystolicBP <span class="sc">+</span> </span>
<span id="cb3-3"><a href="#cb3-3"></a> BMI <span class="sc">+</span> Smoking<span class="sc">+</span> Education, <span class="at">data =</span> dat)</span>
<span id="cb3-4"><a href="#cb3-4"></a>sum_tab1 <span class="ot"><-</span> <span class="fu">summary</span>(tab1, <span class="at">text=</span><span class="cn">TRUE</span>)</span>
<span id="cb3-5"><a href="#cb3-5"></a>sum_tab1</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="cell fragment">
<div class="cell-output cell-output-stdout">
<pre><code>
| | Female (N=143) | Male (N=107) | Total (N=250) | p value|
|:------------|:-----------------:|:-----------------:|:-----------------:|-------:|
|Age | | | | 0.191|
|- Mean (SD) | 56.938 (8.055) | 58.253 (7.550) | 57.501 (7.854) | |
|- Range | 33.700 - 77.500 | 45.700 - 79.300 | 33.700 - 79.300 | |
|Cholesterol | | | | 0.637|
|- N-Miss | 1 | 1 | 2 | |
|- Mean (SD) | 224.929 (25.104) | 223.414 (24.808) | 224.281 (24.939) | |
|- Range | 157.500 - 288.700 | 170.300 - 303.000 | 157.500 - 303.000 | |
|SystolicBP | | | | 0.305|
|- Mean (SD) | 144.946 (10.995) | 146.272 (8.710) | 145.514 (10.083) | |
|- Range | 117.500 - 175.400 | 124.600 - 165.200 | 117.500 - 175.400 | |
|BMI | | | | 0.864|
|- N-Miss | 1 | 0 | 1 | |
|- Mean (SD) | 26.746 (4.592) | 26.842 (4.088) | 26.787 (4.374) | |
|- Range | 13.800 - 38.700 | 14.500 - 35.900 | 13.800 - 38.700 | |
|Smoking | | | | 0.572|
|- | 2 (1.4%) | 1 (0.9%) | 3 (1.2%) | |
|- No | 104 (72.7%) | 72 (67.3%) | 176 (70.4%) | |
|- Yes | 37 (25.9%) | 34 (31.8%) | 71 (28.4%) | |
|Education | | | | 0.289|
|- High | 56 (39.2%) | 52 (48.6%) | 108 (43.2%) | |
|- Low | 45 (31.5%) | 26 (24.3%) | 71 (28.4%) | |
|- Medium | 42 (29.4%) | 29 (27.1%) | 71 (28.4%) | |</code></pre>
</div>
</div>
</section>
<section id="creat-table-1-using-arsenal-package-1" class="slide level2">
<h2>Creat table 1 using <code>arsenal</code> package</h2>
<div class="sourceCode" id="cb5"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1"></a>sum_tab1_out <span class="ot"><-</span> <span class="fu">summary</span>(tab1, <span class="at">text=</span><span class="cn">NULL</span>) <span class="sc">%>%</span> <span class="fu">as.data.frame</span>()</span>
<span id="cb5-2"><a href="#cb5-2"></a><span class="fu">write.csv</span>(sum_tab1_out, <span class="st">'code/table1/result_arsenal_table1.csv'</span>, <span class="at">row.names =</span> F)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<img data-src="images/result_tableby.png" class="r-stretch"></section>
<section id="creat-table-1-using-arsenal-package-2" class="slide level2">
<h2>Creat table 1 using <code>arsenal</code> package</h2>
<h4 id="tableby.control-function">tableby.control() function</h4>
<p>Control test and summary settings for the <em>tableby()</em> function.</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1"></a><span class="fu">tableby.control</span>(</span>
<span id="cb6-2"><a href="#cb6-2"></a> <span class="at">test =</span> <span class="cn">TRUE</span>,</span>
<span id="cb6-3"><a href="#cb6-3"></a> <span class="at">total =</span> <span class="cn">TRUE</span>,</span>
<span id="cb6-4"><a href="#cb6-4"></a> <span class="at">total.pos =</span> <span class="fu">c</span>(<span class="st">"after"</span>, <span class="st">"before"</span>),</span>
<span id="cb6-5"><a href="#cb6-5"></a> <span class="at">test.pname =</span> <span class="cn">NULL</span>,</span>
<span id="cb6-6"><a href="#cb6-6"></a> <span class="at">numeric.simplify =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-7"><a href="#cb6-7"></a> <span class="at">cat.simplify =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-8"><a href="#cb6-8"></a> <span class="at">cat.droplevels =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-9"><a href="#cb6-9"></a> <span class="at">ordered.simplify =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-10"><a href="#cb6-10"></a> <span class="at">date.simplify =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-11"><a href="#cb6-11"></a> <span class="at">numeric.test =</span> <span class="st">"anova"</span>,</span>
<span id="cb6-12"><a href="#cb6-12"></a> <span class="at">cat.test =</span> <span class="st">"chisq"</span>,</span>
<span id="cb6-13"><a href="#cb6-13"></a> <span class="at">ordered.test =</span> <span class="st">"trend"</span>,</span>
<span id="cb6-14"><a href="#cb6-14"></a> <span class="at">surv.test =</span> <span class="st">"logrank"</span>,</span>
<span id="cb6-15"><a href="#cb6-15"></a> <span class="at">date.test =</span> <span class="st">"kwt"</span>,</span>
<span id="cb6-16"><a href="#cb6-16"></a> <span class="at">selectall.test =</span> <span class="st">"notest"</span>,</span>
<span id="cb6-17"><a href="#cb6-17"></a> <span class="at">test.always =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-18"><a href="#cb6-18"></a> <span class="at">numeric.stats =</span> <span class="fu">c</span>(<span class="st">"Nmiss"</span>, <span class="st">"meansd"</span>, <span class="st">"range"</span>),</span>
<span id="cb6-19"><a href="#cb6-19"></a> <span class="at">cat.stats =</span> <span class="fu">c</span>(<span class="st">"Nmiss"</span>, <span class="st">"countpct"</span>),</span>
<span id="cb6-20"><a href="#cb6-20"></a> <span class="at">ordered.stats =</span> <span class="fu">c</span>(<span class="st">"Nmiss"</span>, <span class="st">"countpct"</span>),</span>
<span id="cb6-21"><a href="#cb6-21"></a> <span class="at">surv.stats =</span> <span class="fu">c</span>(<span class="st">"Nmiss"</span>, <span class="st">"Nevents"</span>, <span class="st">"medSurv"</span>),</span>
<span id="cb6-22"><a href="#cb6-22"></a> <span class="at">date.stats =</span> <span class="fu">c</span>(<span class="st">"Nmiss"</span>, <span class="st">"median"</span>, <span class="st">"range"</span>),</span>
<span id="cb6-23"><a href="#cb6-23"></a> <span class="at">selectall.stats =</span> <span class="fu">c</span>(<span class="st">"Nmiss"</span>, <span class="st">"countpct"</span>),</span>
<span id="cb6-24"><a href="#cb6-24"></a> <span class="at">stats.labels =</span> <span class="fu">list</span>(),</span>
<span id="cb6-25"><a href="#cb6-25"></a> <span class="at">digits =</span> 3L,</span>
<span id="cb6-26"><a href="#cb6-26"></a> <span class="at">digits.count =</span> 0L,</span>
<span id="cb6-27"><a href="#cb6-27"></a> <span class="at">digits.pct =</span> 1L,</span>
<span id="cb6-28"><a href="#cb6-28"></a> <span class="at">digits.p =</span> 3L,</span>
<span id="cb6-29"><a href="#cb6-29"></a> <span class="at">format.p =</span> <span class="cn">TRUE</span>,</span>
<span id="cb6-30"><a href="#cb6-30"></a> <span class="at">digits.n =</span> 0L,</span>
<span id="cb6-31"><a href="#cb6-31"></a> <span class="at">conf.level =</span> <span class="fl">0.95</span>,</span>
<span id="cb6-32"><a href="#cb6-32"></a> <span class="at">wilcox.correct =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-33"><a href="#cb6-33"></a> <span class="at">wilcox.exact =</span> <span class="cn">NULL</span>,</span>
<span id="cb6-34"><a href="#cb6-34"></a> <span class="at">chisq.correct =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-35"><a href="#cb6-35"></a> <span class="at">simulate.p.value =</span> <span class="cn">FALSE</span>,</span>
<span id="cb6-36"><a href="#cb6-36"></a> <span class="at">B =</span> <span class="dv">2000</span>,</span>
<span id="cb6-37"><a href="#cb6-37"></a> <span class="at">times =</span> <span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>,</span>
<span id="cb6-38"><a href="#cb6-38"></a> ...</span>
<span id="cb6-39"><a href="#cb6-39"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</section>
<section id="creat-table-1-using-arsenal-package-3" class="slide level2">
<h2>Creat table 1 using <code>arsenal</code> package</h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb7" data-code-line-numbers="|1|4"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1"></a>mycontrols <span class="ot"><-</span> <span class="fu">tableby.control</span>(<span class="at">numeric.stats =</span> <span class="fu">c</span>(<span class="st">"meansd"</span>))</span>
<span id="cb7-2"><a href="#cb7-2"></a>tab1 <span class="ot"><-</span> <span class="fu">tableby</span>(Gender <span class="sc">~</span> Age <span class="sc">+</span> Cholesterol <span class="sc">+</span> SystolicBP <span class="sc">+</span> </span>
<span id="cb7-3"><a href="#cb7-3"></a> BMI <span class="sc">+</span> Smoking<span class="sc">+</span> Education, <span class="at">data =</span> dat,</span>
<span id="cb7-4"><a href="#cb7-4"></a> <span class="at">control =</span> mycontrols)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<div class="fragment">
<p><img data-src="images/result_tableby_control.png" style="width:60.0%"></p>
</div>
</section>
<section id="application-tableby-in-our-paper" class="slide level2">
<h2>Application <code>tableby()</code> in our paper</h2>
<div class="sourceCode" id="cb8"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1"></a>tab1 <span class="ot"><-</span> <span class="fu">tableby</span>(disease_type_en<span class="sc">~</span>sex<span class="sc">+</span>age_group2<span class="sc">+</span>continent<span class="sc">+</span>defi_year,<span class="at">data=</span>data2)</span>
<span id="cb8-2"><a href="#cb8-2"></a>sum_tab1_out <span class="ot"><-</span> <span class="fu">summary</span>(tab1, <span class="at">text=</span><span class="cn">NULL</span>) <span class="sc">%>%</span> <span class="fu">as.data.frame</span>()</span>
<span id="cb8-3"><a href="#cb8-3"></a>writexl<span class="sc">::</span><span class="fu">write_xlsx</span>(sum_tab1_out, <span class="st">'table_1.new.xlsx'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p><img data-src="images/application_table1.png" width="1400" height="800"></p>
</section>
<section id="application-tableby-in-our-paper-1" class="slide level2">
<h2>Application <code>tableby()</code> in our paper</h2>
<img data-src="images/application_table1-2.png" class="r-stretch"></section>
<section id="resources" class="slide level2">
<h2>Resources</h2>
<p><br> <br> 1. <a href="https://cran.r-project.org/web/packages/table1/vignettes/table1-examples.html">Using the table1 Package to Create HTML Tables of Descriptive Statistics</a> <br> <br> <br> 2. <a href="https://cran.r-project.org/web/packages/tableone/vignettes/introduction.html">Introduction to tableone</a> <br> <br> <br> 3. <a href="https://cran.r-project.org/web/packages/arsenal/vignettes/tableby.html">The tableby function</a></p>
</section></section>
<section>
<section id="forestplot" class="title-slide slide level1 center">
<h1>Forestplot</h1>
</section>
<section id="what-is-forestplot" class="slide level2">
<h2>What is <code>forestplot</code>?</h2>
<div class="columns">
<div class="column" style="width:55%;">
<p>A <strong>forest plot</strong>, also known as a blobbogram, is a graphical display of <strong>estimated results from a number of scientific studies addressing the same question</strong>, along with the overall results.</p>
<p><img data-src="images/paper_fp.png"></p>
</div><div class="column" style="width:5%;">
</div><div class="column" style="width:40%;">
<p><img data-src="images/paper_fp2.png" style="width:120.0%"></p>
</div>
</div>
</section>
<section id="data-preparation" class="slide level2">
<h2>Data Preparation</h2>
<div class="columns">
<div class="column" style="width:60%;">
<div class="cell">
<div class="sourceCode cell-code" id="cb9" data-code-line-numbers="|1|3"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1"></a><span class="fu">library</span>(forestplot) <span class="co"># main package</span></span>
<span id="cb9-2"><a href="#cb9-2"></a>fp <span class="ot"><-</span> <span class="fu">read.csv</span>(<span class="st">"examples/data/forestplot.csv"</span>,</span>
<span id="cb9-3"><a href="#cb9-3"></a> <span class="at">header =</span> F)</span>
<span id="cb9-4"><a href="#cb9-4"></a>fp</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> V1 V2 V3 V4 V5
1 Disease Percentage Changes (95% CI) NA NA NA
2 Arrhythmia NA NA NA
3 Age NA NA NA
4 <65 -2.14(-4.02 to -0.27) -2.14 -4.02 -0.27
5 >=65 -0.31(-1.8 to 1.19) -0.31 -1.80 1.19
6 Sex NA NA NA
7 Male -1.22(-3.1 to 0.65) -1.22 -3.10 0.65
8 Female -0.55(-2.23 to 1.12) -0.55 -2.23 1.12
9 NA NA NA
10 Cerebrovascular NA NA NA
11 Age NA NA NA
12 <65 -0.11(-0.62 to 0.4) -0.11 -0.62 0.40
13 >=65 -0.05(-0.51 to 0.41) -0.05 -0.51 0.41
14 Sex NA NA NA
15 Male 0.12(-0.36 to 0.59) 0.12 -0.36 0.59
16 Female -0.3(-0.86 to 0.25) -0.30 -0.86 0.25
17 NA NA NA
18 CHD NA NA NA
19 Age NA NA NA
20 <65 1.67(0.68 to 2.67) 1.67 0.68 2.67
21 >=65 0.84(0.09 to 1.58) 0.84 0.09 1.58
22 Sex NA NA NA
23 Male 1.28(0.42 to 2.15) 1.28 0.42 2.15
24 Female 1.01(0.18 to 1.83) 1.01 0.18 1.83
25 NA NA NA
26 Heart failure NA NA NA
27 Age NA NA NA
28 <65 1.23(-2.65 to 5.11) 1.23 -2.65 5.11
29 >=65 -0.67(-2.65 to 1.32) -0.67 -2.65 1.32
30 Sex NA NA NA
31 Male 0.54(-1.95 to 3.03) 0.54 -1.95 3.03
32 Female -1.09(-3.6 to 1.42) -1.09 -3.60 1.42</code></pre>
</div>
</div>
</div><div class="column" style="width:40%;">
<p><img data-src="images/data.png" style="width:140.0%"></p>
</div>
</div>
</section>
<section id="a-simple-forestplot" class="slide level2">
<h2>A <code>simple</code> forestplot</h2>
<div class="cell columns column-output-location">
<div class="column">
<div class="sourceCode cell-code" id="cb11" data-code-line-numbers="|2|3|4|5"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1"></a><span class="fu">forestplot</span>(</span>
<span id="cb11-2"><a href="#cb11-2"></a> <span class="at">labeltext =</span> <span class="fu">as.matrix</span>(fp[,<span class="dv">1</span><span class="sc">:</span><span class="dv">2</span>]),<span class="co">#设置文本列</span></span>
<span id="cb11-3"><a href="#cb11-3"></a> <span class="at">mean =</span> fp<span class="sc">$</span>V3, <span class="co">#均值</span></span>
<span id="cb11-4"><a href="#cb11-4"></a> <span class="at">lower =</span> fp<span class="sc">$</span>V4,<span class="co">#95%下限</span></span>
<span id="cb11-5"><a href="#cb11-5"></a> <span class="at">upper =</span> fp<span class="sc">$</span>V5 <span class="co">#95%上限</span></span>
<span id="cb11-6"><a href="#cb11-6"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div><div class="column">
<div class="cell-output-display">
<p><img data-src="index_files/figure-revealjs/simple%20fp-1.png" width="960"></p>
</div>
</div>
</div>
</section>
<section id="a-complex-forestplot" class="slide level2">
<h2>A <code>complex</code> forestplot</h2>
<div class="cell columns column-output-location">
<div class="column">
<div class="sourceCode cell-code" id="cb12" data-code-line-numbers="2-5|6|7|8-11|12-22|23|24-27|28-39"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1"></a><span class="fu">forestplot</span>(</span>
<span id="cb12-2"><a href="#cb12-2"></a> <span class="at">labeltext =</span> <span class="fu">as.matrix</span>(fp[,<span class="dv">1</span><span class="sc">:</span><span class="dv">2</span>]),<span class="co">#设置文本列#</span></span>
<span id="cb12-3"><a href="#cb12-3"></a> <span class="at">mean =</span> fp<span class="sc">$</span>V3, <span class="co">#绘图用的均值#</span></span>
<span id="cb12-4"><a href="#cb12-4"></a> <span class="at">lower =</span> fp<span class="sc">$</span>V4,</span>
<span id="cb12-5"><a href="#cb12-5"></a> <span class="at">upper =</span> fp<span class="sc">$</span>V5,</span>
<span id="cb12-6"><a href="#cb12-6"></a> <span class="at">is.summary =</span> <span class="fu">c</span>(T,<span class="fu">rep</span>(<span class="fu">c</span>(T,F,F,F,F,F,F,F),<span class="dv">3</span>),T,F,F,F,F,F,F), <span class="co">#某行是否加粗显示#</span></span>
<span id="cb12-7"><a href="#cb12-7"></a> <span class="at">zero =</span> <span class="dv">0</span>, </span>
<span id="cb12-8"><a href="#cb12-8"></a> <span class="at">col =</span> <span class="fu">fpColors</span>(<span class="at">box=</span><span class="st">'blue'</span>, <span class="co">#均值点的颜色#</span></span>
<span id="cb12-9"><a href="#cb12-9"></a> <span class="at">summary=</span><span class="st">'#8B008B'</span>, <span class="co">#加粗行的颜色#</span></span>
<span id="cb12-10"><a href="#cb12-10"></a> <span class="at">lines =</span> <span class="st">'black'</span>, <span class="co">#95%CI线的颜色#</span></span>
<span id="cb12-11"><a href="#cb12-11"></a> <span class="at">zero =</span> <span class="st">'skyblue'</span>), <span class="co">#无效线的颜色#</span></span>
<span id="cb12-12"><a href="#cb12-12"></a> <span class="at">boxsize =</span> <span class="fl">0.5</span>, <span class="co">#均值点图形的大小#</span></span>
<span id="cb12-13"><a href="#cb12-13"></a> <span class="at">lineheight =</span> <span class="fu">unit</span>(<span class="dv">8</span>,<span class="st">'mm'</span>), <span class="co">#行距#</span></span>
<span id="cb12-14"><a href="#cb12-14"></a> <span class="at">colgap =</span> <span class="fu">unit</span>(<span class="dv">2</span>,<span class="st">'mm'</span>), <span class="co">#列宽#</span></span>
<span id="cb12-15"><a href="#cb12-15"></a> <span class="at">lwd.zero =</span> <span class="dv">1</span>,<span class="co"># 无效线宽度</span></span>
<span id="cb12-16"><a href="#cb12-16"></a> <span class="at">lwd.ci =</span> <span class="dv">1</span>, <span class="co"># 95%CI线宽度</span></span>
<span id="cb12-17"><a href="#cb12-17"></a> <span class="at">xlab =</span> <span class="st">'The estimate'</span>, <span class="co">#x轴的标题#</span></span>
<span id="cb12-18"><a href="#cb12-18"></a> <span class="at">lwd.xaxis =</span> <span class="dv">1</span>, <span class="co">#x 轴的刻度#</span></span>
<span id="cb12-19"><a href="#cb12-19"></a> <span class="at">lty.ci =</span> <span class="dv">1</span>,<span class="co"># 95%CI线类型</span></span>
<span id="cb12-20"><a href="#cb12-20"></a> <span class="at">ci.vertices =</span> T, <span class="co">#是否在95%CI两头添加箭头#</span></span>
<span id="cb12-21"><a href="#cb12-21"></a> <span class="at">ci.vertices.height =</span> <span class="fl">0.15</span>, <span class="co">#箭头的长短#</span></span>
<span id="cb12-22"><a href="#cb12-22"></a> <span class="at">graph.pos =</span> <span class="dv">2</span>, <span class="co">#森林图画在第几列#</span></span>
<span id="cb12-23"><a href="#cb12-23"></a> <span class="at">fn.ci_norm =</span> fpDrawNormalCI, <span class="co">#均值点的形状,Normal是方形,Circel是圆形,Diamod是菱形,Ponit是点#</span></span>
<span id="cb12-24"><a href="#cb12-24"></a> <span class="at">txt_gp =</span> <span class="fu">fpTxtGp</span>(</span>
<span id="cb12-25"><a href="#cb12-25"></a> <span class="at">ticks =</span> <span class="fu">gpar</span>(<span class="at">cex =</span> <span class="dv">1</span>), <span class="co">#坐标轴上刻度的大小#</span></span>
<span id="cb12-26"><a href="#cb12-26"></a> <span class="at">xlab =</span> <span class="fu">gpar</span>(<span class="at">cex =</span> <span class="dv">1</span>), <span class="co">#x轴名称的大小#</span></span>
<span id="cb12-27"><a href="#cb12-27"></a> <span class="at">label =</span> <span class="fu">gpar</span>(<span class="at">cex =</span> <span class="dv">1</span>)), <span class="co">#开始用labeltext()函数设置的文本字体的大小#</span></span>
<span id="cb12-28"><a href="#cb12-28"></a> <span class="at">hrzl_lines=</span><span class="fu">list</span>( <span class="st">"1"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">1</span>, <span class="at">col=</span><span class="st">"black"</span>,<span class="at">fill=</span><span class="st">"black"</span>), <span class="co">#在表的第1行上边加一条黑线#</span></span>
<span id="cb12-29"><a href="#cb12-29"></a> <span class="st">"2"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">1</span>, <span class="at">col=</span><span class="st">"black"</span>,<span class="at">fill=</span><span class="st">"black"</span>),<span class="co">#在表的第2行上边加一条黑线#</span></span>
<span id="cb12-30"><a href="#cb12-30"></a> <span class="st">"33"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">1</span>, <span class="at">col=</span><span class="st">"black"</span>,<span class="at">fill=</span><span class="st">"black"</span>),<span class="co">#在表的第33行上边加一条黑线</span></span>
<span id="cb12-31"><a href="#cb12-31"></a> <span class="co">#在表的第5行上边加一条宽度为60,线型两端为butt,颜色为#898988,透明度为55的线段,线段分布在表格的2-3列</span></span>
<span id="cb12-32"><a href="#cb12-32"></a> <span class="st">"5"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-33"><a href="#cb12-33"></a> <span class="st">"8"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-34"><a href="#cb12-34"></a> <span class="st">"13"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-35"><a href="#cb12-35"></a> <span class="st">"16"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-36"><a href="#cb12-36"></a> <span class="st">"21"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-37"><a href="#cb12-37"></a> <span class="st">"24"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-38"><a href="#cb12-38"></a> <span class="st">"29"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb12-39"><a href="#cb12-39"></a> <span class="st">"32"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>)</span>
<span id="cb12-40"><a href="#cb12-40"></a> )</span>
<span id="cb12-41"><a href="#cb12-41"></a> </span>
<span id="cb12-42"><a href="#cb12-42"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div><div class="column">
<div class="cell-output-display">
<p><img data-src="index_files/figure-revealjs/complex%20fp-1.png" width="960"></p>
</div>
</div>
</div>
</section>
<section id="forestplot-with-different-color" class="slide level2">
<h2>Forestplot with <code>different color</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb13" data-code-line-numbers="|4-5"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1"></a>fn <span class="ot"><-</span> <span class="fu">local</span>({</span>
<span id="cb13-2"><a href="#cb13-2"></a> i <span class="ot">=</span> <span class="dv">0</span></span>
<span id="cb13-3"><a href="#cb13-3"></a> no_lines <span class="ot"><-</span> <span class="fu">sum</span>(<span class="sc">!</span><span class="fu">is.na</span>(fp<span class="sc">$</span>V3))</span>
<span id="cb13-4"><a href="#cb13-4"></a> b_clrs <span class="ot">=</span> <span class="fu">colorRampPalette</span>(<span class="at">colors=</span><span class="fu">c</span>(<span class="fu">rep</span>(<span class="st">'blue'</span>, <span class="dv">8</span>), <span class="fu">rep</span>(<span class="st">'red'</span>, <span class="dv">4</span>), <span class="fu">rep</span>(<span class="st">'blue'</span>, <span class="dv">4</span>)))(no_lines)</span>
<span id="cb13-5"><a href="#cb13-5"></a> l_clrs <span class="ot">=</span> <span class="fu">colorRampPalette</span>(<span class="at">colors=</span><span class="fu">c</span>(<span class="fu">rep</span>(<span class="st">'blue'</span>, <span class="dv">8</span>), <span class="fu">rep</span>(<span class="st">'red'</span>, <span class="dv">4</span>), <span class="fu">rep</span>(<span class="st">'blue'</span>, <span class="dv">4</span>)))(no_lines)</span>
<span id="cb13-6"><a href="#cb13-6"></a> </span>
<span id="cb13-7"><a href="#cb13-7"></a> <span class="cf">function</span>(..., clr.line, clr.marker){</span>
<span id="cb13-8"><a href="#cb13-8"></a> i <span class="ot"><<-</span> i <span class="sc">+</span> <span class="dv">1</span></span>
<span id="cb13-9"><a href="#cb13-9"></a> <span class="fu">fpDrawNormalCI</span>(..., <span class="at">clr.line =</span> l_clrs[i], <span class="at">clr.marker =</span> b_clrs[i])</span>
<span id="cb13-10"><a href="#cb13-10"></a> }</span>
<span id="cb13-11"><a href="#cb13-11"></a>})</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<p><br></p>
<div class="cell" data-layout-align="center">
<div class="sourceCode cell-code" id="cb14" data-code-line-numbers="23"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1"></a><span class="fu">forestplot</span>(</span>
<span id="cb14-2"><a href="#cb14-2"></a> <span class="at">labeltext =</span> <span class="fu">as.matrix</span>(fp[,<span class="dv">1</span><span class="sc">:</span><span class="dv">2</span>]),<span class="co">#设置文本列#</span></span>
<span id="cb14-3"><a href="#cb14-3"></a> <span class="at">mean =</span> fp<span class="sc">$</span>V3, <span class="co">#绘图用的均值#</span></span>
<span id="cb14-4"><a href="#cb14-4"></a> <span class="at">lower =</span> fp<span class="sc">$</span>V4,</span>
<span id="cb14-5"><a href="#cb14-5"></a> <span class="at">upper =</span> fp<span class="sc">$</span>V5,</span>
<span id="cb14-6"><a href="#cb14-6"></a> <span class="at">is.summary =</span> <span class="fu">c</span>(T,<span class="fu">rep</span>(<span class="fu">c</span>(T,F,F,F,F,F,F,F),<span class="dv">3</span>),T,F,F,F,F,F,F), <span class="co">#某行是否加粗显示#</span></span>
<span id="cb14-7"><a href="#cb14-7"></a> <span class="at">zero =</span> <span class="dv">0</span>, </span>
<span id="cb14-8"><a href="#cb14-8"></a> <span class="at">col =</span> <span class="fu">fpColors</span>(<span class="at">box=</span><span class="st">'blue'</span>, <span class="co">#均值点的颜色#</span></span>
<span id="cb14-9"><a href="#cb14-9"></a> <span class="at">summary=</span><span class="st">'#8B008B'</span>, <span class="co">#加粗行的颜色#</span></span>
<span id="cb14-10"><a href="#cb14-10"></a> <span class="at">lines =</span> <span class="st">'black'</span>, <span class="co">#95%CI线的颜色#</span></span>
<span id="cb14-11"><a href="#cb14-11"></a> <span class="at">zero =</span> <span class="st">'skyblue'</span>), <span class="co">#无效线的颜色#</span></span>
<span id="cb14-12"><a href="#cb14-12"></a> <span class="at">boxsize =</span> <span class="fl">0.5</span>, <span class="co">#均值点图形的大小#</span></span>
<span id="cb14-13"><a href="#cb14-13"></a> <span class="at">lineheight =</span> <span class="fu">unit</span>(<span class="dv">8</span>,<span class="st">'mm'</span>), <span class="co">#行距#</span></span>
<span id="cb14-14"><a href="#cb14-14"></a> <span class="at">colgap =</span> <span class="fu">unit</span>(<span class="dv">2</span>,<span class="st">'mm'</span>), <span class="co">#列宽#</span></span>
<span id="cb14-15"><a href="#cb14-15"></a> <span class="at">lwd.zero =</span> <span class="dv">1</span>,<span class="co"># 无效线宽度</span></span>
<span id="cb14-16"><a href="#cb14-16"></a> <span class="at">lwd.ci =</span> <span class="dv">1</span>, <span class="co"># 95%CI线宽度</span></span>
<span id="cb14-17"><a href="#cb14-17"></a> <span class="at">xlab =</span> <span class="st">'The estimate'</span>, <span class="co">#x轴的标题#</span></span>
<span id="cb14-18"><a href="#cb14-18"></a> <span class="at">lwd.xaxis =</span> <span class="dv">1</span>, <span class="co">#x 轴的刻度#</span></span>
<span id="cb14-19"><a href="#cb14-19"></a> <span class="at">lty.ci =</span> <span class="dv">1</span>,<span class="co"># 95%CI线类型</span></span>
<span id="cb14-20"><a href="#cb14-20"></a> <span class="at">ci.vertices =</span> T, <span class="co">#是否在95%CI两头添加箭头#</span></span>
<span id="cb14-21"><a href="#cb14-21"></a> <span class="at">ci.vertices.height =</span> <span class="fl">0.15</span>, <span class="co">#箭头的长短#</span></span>
<span id="cb14-22"><a href="#cb14-22"></a> <span class="at">graph.pos =</span> <span class="dv">2</span>, <span class="co">#森林图画在第几列#</span></span>
<span id="cb14-23"><a href="#cb14-23"></a> <span class="at">fn.ci_norm =</span> fn, <span class="co">#均值点的形状,Normal是方形,Circel是圆形,Diamod是菱形,Ponit是点#</span></span>
<span id="cb14-24"><a href="#cb14-24"></a> <span class="at">txt_gp =</span> <span class="fu">fpTxtGp</span>(</span>
<span id="cb14-25"><a href="#cb14-25"></a> <span class="at">ticks =</span> <span class="fu">gpar</span>(<span class="at">cex =</span> <span class="dv">1</span>), <span class="co">#坐标轴上刻度的大小#</span></span>
<span id="cb14-26"><a href="#cb14-26"></a> <span class="at">xlab =</span> <span class="fu">gpar</span>(<span class="at">cex =</span> <span class="dv">1</span>), <span class="co">#x轴名称的大小#</span></span>
<span id="cb14-27"><a href="#cb14-27"></a> <span class="at">label =</span> <span class="fu">gpar</span>(<span class="at">cex =</span> <span class="dv">1</span>)), <span class="co">#开始用labeltext()函数设置的文本字体的大小#</span></span>
<span id="cb14-28"><a href="#cb14-28"></a> <span class="at">hrzl_lines=</span><span class="fu">list</span>( <span class="st">"1"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">1</span>, <span class="at">col=</span><span class="st">"black"</span>,<span class="at">fill=</span><span class="st">"black"</span>), <span class="co">#在表的第1行上边加一条黑线#</span></span>
<span id="cb14-29"><a href="#cb14-29"></a> <span class="st">"2"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">1</span>, <span class="at">col=</span><span class="st">"black"</span>,<span class="at">fill=</span><span class="st">"black"</span>),<span class="co">#在表的第2行上边加一条黑线#</span></span>
<span id="cb14-30"><a href="#cb14-30"></a> <span class="st">"33"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">1</span>, <span class="at">col=</span><span class="st">"black"</span>,<span class="at">fill=</span><span class="st">"black"</span>),<span class="co">#在表的第33行上边加一条黑线</span></span>
<span id="cb14-31"><a href="#cb14-31"></a> <span class="co">#在表的第5行上边加一条宽度为60,线型两端为butt,颜色为#898988,透明度为55的线段,线段分布在表格的2-3列</span></span>
<span id="cb14-32"><a href="#cb14-32"></a> <span class="st">"5"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-33"><a href="#cb14-33"></a> <span class="st">"8"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-34"><a href="#cb14-34"></a> <span class="st">"13"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-35"><a href="#cb14-35"></a> <span class="st">"16"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-36"><a href="#cb14-36"></a> <span class="st">"21"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-37"><a href="#cb14-37"></a> <span class="st">"24"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-38"><a href="#cb14-38"></a> <span class="st">"29"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>),</span>
<span id="cb14-39"><a href="#cb14-39"></a> <span class="st">"32"</span> <span class="ot">=</span> <span class="fu">gpar</span>(<span class="at">lty=</span><span class="dv">1</span>,<span class="at">lwd=</span><span class="dv">60</span>,<span class="at">lineend=</span><span class="st">"butt"</span>,<span class="at">columns=</span><span class="fu">c</span>(<span class="dv">2</span><span class="sc">:</span><span class="dv">3</span>),<span class="at">col=</span><span class="st">"#89898855"</span>)</span>
<span id="cb14-40"><a href="#cb14-40"></a> )</span>
<span id="cb14-41"><a href="#cb14-41"></a> </span>
<span id="cb14-42"><a href="#cb14-42"></a>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="forestplot-with-different-color-output" class="slide level2 output-location-slide"><h2>Forestplot with <code>different color</code></h2><div class="cell output-location-slide" data-layout-align="center">
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure>
<p><img data-src="index_files/figure-revealjs/colored%20fp-1.png" width="960"></p>
</figure>
</div>
</div>
</div></section><section id="creat-forestplot-using-ggplot2-package" class="slide level2">
<h2>Creat forestplot using <code>ggplot2</code> package</h2>
<img data-src="images/ggfp9.png" class="r-stretch"></section>
<section id="step-0-data-preparation" class="slide level2">
<h2>Step 0: <code>Data Preparation</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb15"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1"></a><span class="fu">library</span>(ggplot2)</span>
<span id="cb15-2"><a href="#cb15-2"></a>dat <span class="ot">=</span> <span class="fu">read.csv</span>(<span class="st">"examples/data/forestplot_ggplot.csv"</span>)</span>
<span id="cb15-3"><a href="#cb15-3"></a>dat</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code> Disease group PC PC_95_LOW PC_95_UP
1 Arrhythmia <65 -2.14 -4.02 -0.27
2 Arrhythmia >=65 -0.31 -1.80 1.19
3 Arrhythmia Male -1.22 -3.10 0.65
4 Arrhythmia Female -0.55 -2.23 1.12
5 Cerebrovascular <65 -0.11 -0.62 0.40
6 Cerebrovascular >=65 -0.05 -0.51 0.41
7 Cerebrovascular Male 0.12 -0.36 0.59
8 Cerebrovascular Female -0.30 -0.86 0.25
9 CHD <65 1.67 0.68 2.67
10 CHD >=65 0.84 0.09 1.58
11 CHD Male 1.28 0.42 2.15
12 CHD Female 1.01 0.18 1.83
13 Heart failure <65 1.23 -2.65 5.11
14 Heart failure >=65 -0.67 -2.65 1.32
15 Heart failure Male 0.54 -1.95 3.03
16 Heart failure Female -1.09 -3.60 1.42</code></pre>
</div>
</div>
</section>
<section id="step-1-mapping-data" class="slide level2">
<h2>Step 1: <code>Mapping data</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb17" data-code-line-numbers="1"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/ggplot%20Step%201%20blank-1.png" width="960" class="r-stretch"></section>
<section id="step-2-add-point" class="slide level2">
<h2>Step 2: <code>Add point</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb18" data-code-line-numbers="2"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb18-2"><a href="#cb18-2"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/ggplot%20Step%202%20point-1.png" width="960" class="r-stretch"></section>
<section id="step-3-add-errorbar" class="slide level2">
<h2>Step 3: <code>Add errorbar</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb19" data-code-line-numbers="3"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb19-2"><a href="#cb19-2"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>)<span class="sc">+</span></span>
<span id="cb19-3"><a href="#cb19-3"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/ggplot%20Step%203%20errorbar-1.png" width="960" class="r-stretch"></section>
<section id="step-4-add-horizontal-line" class="slide level2">
<h2>Step 4: <code>Add horizontal line</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb20" data-code-line-numbers="4"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb20-2"><a href="#cb20-2"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb20-3"><a href="#cb20-3"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>)<span class="sc">+</span></span>
<span id="cb20-4"><a href="#cb20-4"></a><span class="fu">geom_hline</span>(<span class="at">yintercept =</span> <span class="dv">0</span>, <span class="at">linetype =</span> <span class="st">"dashed"</span>, <span class="at">colour =</span> <span class="st">"black"</span>, <span class="at">size =</span> <span class="fl">0.5</span>) </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/Step%204%20hline-1.png" width="960" class="r-stretch"></section>
<section id="step-5-set-axis" class="slide level2">
<h2>Step 5: <code>Set axis</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb21" data-code-line-numbers="5-6"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb21-2"><a href="#cb21-2"></a><span class="fu">geom_hline</span>(<span class="at">yintercept =</span> <span class="dv">0</span>, <span class="at">linetype =</span> <span class="st">"dashed"</span>, <span class="at">colour =</span> <span class="st">"black"</span>, <span class="at">size =</span> <span class="fl">0.5</span>) <span class="sc">+</span></span>
<span id="cb21-3"><a href="#cb21-3"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb21-4"><a href="#cb21-4"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>) <span class="sc">+</span></span>
<span id="cb21-5"><a href="#cb21-5"></a><span class="fu">xlab</span>(<span class="st">""</span>)<span class="sc">+</span></span>
<span id="cb21-6"><a href="#cb21-6"></a><span class="fu">scale_y_continuous</span>(<span class="st">"Percentage Change (%) and 95% CI"</span>, <span class="at">labels =</span> scales<span class="sc">::</span><span class="fu">number_format</span>(<span class="at">accuracy =</span> <span class="fl">0.01</span>))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/Step%205%20axis%20setting-1.png" width="960" class="r-stretch"></section>
<section id="step-6-set-point-shape-and-color" class="slide level2">
<h2>Step 6: <code>Set point shape and color</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb22" data-code-line-numbers="7-9"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb22-2"><a href="#cb22-2"></a><span class="fu">geom_hline</span>(<span class="at">yintercept =</span> <span class="dv">0</span>, <span class="at">linetype =</span> <span class="st">"dashed"</span>, <span class="at">colour =</span> <span class="st">"black"</span>, <span class="at">size =</span> <span class="fl">0.5</span>) <span class="sc">+</span></span>
<span id="cb22-3"><a href="#cb22-3"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb22-4"><a href="#cb22-4"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>) <span class="sc">+</span></span>
<span id="cb22-5"><a href="#cb22-5"></a><span class="fu">xlab</span>(<span class="st">""</span>)<span class="sc">+</span></span>
<span id="cb22-6"><a href="#cb22-6"></a><span class="fu">scale_y_continuous</span>(<span class="st">"Percentage Change (%) and 95% CI"</span>, <span class="at">labels =</span> scales<span class="sc">::</span><span class="fu">number_format</span>(<span class="at">accuracy =</span> <span class="fl">0.01</span>))<span class="sc">+</span></span>
<span id="cb22-7"><a href="#cb22-7"></a><span class="fu">scale_shape_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="dv">16</span>, <span class="dv">23</span>, <span class="dv">24</span>, <span class="dv">15</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb22-8"><a href="#cb22-8"></a><span class="fu">scale_fill_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb22-9"><a href="#cb22-9"></a><span class="fu">scale_colour_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/Step%206-1.png" width="960" class="r-stretch"></section>
<section id="step-7-set-theme" class="slide level2">
<h2>Step 7: <code>Set theme</code></h2>
<div class="cell">
<div class="sourceCode cell-code" id="cb23" data-code-line-numbers="10-18"><pre class="sourceCode numberSource r fourlinesish number-lines code-with-copy"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1"></a><span class="fu">ggplot</span>(dat, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb23-2"><a href="#cb23-2"></a><span class="fu">geom_hline</span>(<span class="at">yintercept =</span> <span class="dv">0</span>, <span class="at">linetype =</span> <span class="st">"dashed"</span>, <span class="at">colour =</span> <span class="st">"black"</span>, <span class="at">size =</span> <span class="fl">0.5</span>) <span class="sc">+</span></span>
<span id="cb23-3"><a href="#cb23-3"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb23-4"><a href="#cb23-4"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>) <span class="sc">+</span></span>
<span id="cb23-5"><a href="#cb23-5"></a><span class="fu">xlab</span>(<span class="st">""</span>)<span class="sc">+</span></span>
<span id="cb23-6"><a href="#cb23-6"></a><span class="fu">scale_y_continuous</span>(<span class="st">"Percentage Change (%) and 95% CI"</span>, <span class="at">labels =</span> scales<span class="sc">::</span><span class="fu">number_format</span>(<span class="at">accuracy =</span> <span class="fl">0.01</span>))<span class="sc">+</span></span>
<span id="cb23-7"><a href="#cb23-7"></a><span class="fu">scale_shape_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="dv">16</span>, <span class="dv">23</span>, <span class="dv">24</span>, <span class="dv">15</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb23-8"><a href="#cb23-8"></a><span class="fu">scale_fill_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb23-9"><a href="#cb23-9"></a><span class="fu">scale_colour_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb23-10"><a href="#cb23-10"></a><span class="fu">theme_bw</span>() <span class="sc">+</span></span>
<span id="cb23-11"><a href="#cb23-11"></a><span class="fu">theme</span>(<span class="at">panel.grid.major =</span> <span class="fu">element_blank</span>(), <span class="at">panel.grid.minor =</span> <span class="fu">element_blank</span>()) <span class="sc">+</span></span>
<span id="cb23-12"><a href="#cb23-12"></a><span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"top"</span>) <span class="sc">+</span> <span class="co"># top</span></span>
<span id="cb23-13"><a href="#cb23-13"></a><span class="fu">theme</span>(<span class="at">legend.key =</span> <span class="fu">element_blank</span>()) <span class="sc">+</span></span>
<span id="cb23-14"><a href="#cb23-14"></a><span class="fu">theme</span>(<span class="at">legend.background =</span> <span class="fu">element_rect</span>(<span class="at">fill =</span> <span class="st">"white"</span>, <span class="at">colour =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb23-15"><a href="#cb23-15"></a><span class="fu">theme</span>(<span class="at">legend.text =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">10</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb23-16"><a href="#cb23-16"></a><span class="fu">theme</span>(<span class="at">legend.key.height =</span> <span class="fu">unit</span>(<span class="fl">0.3</span>, <span class="st">"cm"</span>)) <span class="sc">+</span></span>
<span id="cb23-17"><a href="#cb23-17"></a><span class="fu">theme</span>(<span class="at">axis.text.y =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">12</span>, <span class="at">angle =</span> <span class="dv">0</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb23-18"><a href="#cb23-18"></a><span class="fu">theme</span>(<span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">12</span>, <span class="at">color =</span> <span class="st">"black"</span>)) </span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
<img data-src="index_files/figure-revealjs/Step%207-1.png" width="960" class="r-stretch"></section>
<section id="more-categorical-variables" class="slide level2">
<h2>More <code>categorical</code> variables?</h2>
<div class="cell">
<div class="cell-output cell-output-stdout">
<pre><code> Disease group PC PC_95_LOW PC_95_UP country
1 Arrhythmia <65 -2.14 -4.02 -0.27 China
2 Arrhythmia >=65 -0.31 -1.80 1.19 China
3 Arrhythmia Male -1.22 -3.10 0.65 China
4 Arrhythmia Female -0.55 -2.23 1.12 China
5 Cerebrovascular <65 -0.11 -0.62 0.40 China
6 Cerebrovascular >=65 -0.05 -0.51 0.41 China
7 Cerebrovascular Male 0.12 -0.36 0.59 China
8 Cerebrovascular Female -0.30 -0.86 0.25 China
9 CHD <65 1.67 0.68 2.67 China
10 CHD >=65 0.84 0.09 1.58 China
11 CHD Male 1.28 0.42 2.15 China
12 CHD Female 1.01 0.18 1.83 China
13 Heart failure <65 1.23 -2.65 5.11 China
14 Heart failure >=65 -0.67 -2.65 1.32 China
15 Heart failure Male 0.54 -1.95 3.03 China
16 Heart failure Female -1.09 -3.60 1.42 China
17 Arrhythmia <65 -2.14 -4.02 -0.27 USA
18 Arrhythmia >=65 -0.31 -1.80 1.19 USA
19 Arrhythmia Male -1.22 -3.10 0.65 USA
20 Arrhythmia Female -0.55 -2.23 1.12 USA
21 Cerebrovascular <65 -0.11 -0.62 0.40 USA
22 Cerebrovascular >=65 -0.05 -0.51 0.41 USA
23 Cerebrovascular Male 0.12 -0.36 0.59 USA
24 Cerebrovascular Female -0.30 -0.86 0.25 USA
25 CHD <65 1.67 0.68 2.67 USA
26 CHD >=65 0.84 0.09 1.58 USA
27 CHD Male 1.28 0.42 2.15 USA
28 CHD Female 1.01 0.18 1.83 USA
29 Heart failure <65 1.23 -2.65 5.11 USA
30 Heart failure >=65 -0.67 -2.65 1.32 USA
31 Heart failure Male 0.54 -1.95 3.03 USA
32 Heart failure Female -1.09 -3.60 1.42 USA</code></pre>
</div>
</div>
</section>
<section id="facet-in-ggplot2" class="slide level2">
<h2><code>Facet</code> in ggplot2</h2>
<div class="cell" data-fig.dim="[10,4]">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb25" data-code-line-numbers="19"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1"></a><span class="fu">ggplot</span>(dat2, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb25-2"><a href="#cb25-2"></a><span class="fu">geom_hline</span>(<span class="at">yintercept =</span> <span class="dv">0</span>, <span class="at">linetype =</span> <span class="st">"dashed"</span>, <span class="at">colour =</span> <span class="st">"black"</span>, <span class="at">size =</span> <span class="fl">0.5</span>) <span class="sc">+</span></span>
<span id="cb25-3"><a href="#cb25-3"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb25-4"><a href="#cb25-4"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>) <span class="sc">+</span></span>
<span id="cb25-5"><a href="#cb25-5"></a><span class="fu">scale_y_continuous</span>(<span class="st">"Percentage Change (%) and 95% CI"</span>, <span class="at">labels =</span> scales<span class="sc">::</span><span class="fu">number_format</span>(<span class="at">accuracy =</span> <span class="fl">0.01</span>))<span class="sc">+</span></span>
<span id="cb25-6"><a href="#cb25-6"></a><span class="fu">scale_shape_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="dv">16</span>, <span class="dv">23</span>, <span class="dv">24</span>, <span class="dv">15</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb25-7"><a href="#cb25-7"></a><span class="fu">scale_fill_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb25-8"><a href="#cb25-8"></a><span class="fu">scale_colour_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb25-9"><a href="#cb25-9"></a><span class="fu">theme_bw</span>() <span class="sc">+</span></span>
<span id="cb25-10"><a href="#cb25-10"></a> <span class="fu">theme</span>(<span class="at">panel.grid.major =</span> <span class="fu">element_blank</span>(), <span class="at">panel.grid.minor =</span> <span class="fu">element_blank</span>()) <span class="sc">+</span></span>
<span id="cb25-11"><a href="#cb25-11"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"top"</span>) <span class="sc">+</span> </span>
<span id="cb25-12"><a href="#cb25-12"></a> <span class="fu">theme</span>(<span class="at">legend.key =</span> <span class="fu">element_blank</span>()) <span class="sc">+</span></span>
<span id="cb25-13"><a href="#cb25-13"></a> <span class="fu">theme</span>(<span class="at">legend.background =</span> <span class="fu">element_rect</span>(<span class="at">fill =</span> <span class="st">"white"</span>, <span class="at">colour =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb25-14"><a href="#cb25-14"></a> <span class="fu">theme</span>(<span class="at">legend.text =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">10</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb25-15"><a href="#cb25-15"></a> <span class="fu">theme</span>(<span class="at">legend.key.height =</span> <span class="fu">unit</span>(<span class="fl">0.3</span>, <span class="st">"cm"</span>)) <span class="sc">+</span></span>
<span id="cb25-16"><a href="#cb25-16"></a> <span class="fu">theme</span>(<span class="at">axis.text.y =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">12</span>, <span class="at">angle =</span> <span class="dv">0</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb25-17"><a href="#cb25-17"></a> <span class="fu">theme</span>(<span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">12</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb25-18"><a href="#cb25-18"></a> <span class="fu">xlab</span>(<span class="st">""</span>) <span class="sc">+</span></span>
<span id="cb25-19"><a href="#cb25-19"></a> <span class="fu">facet_wrap</span>(<span class="fu">vars</span>(country))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<img data-src="index_files/figure-revealjs/facet-1.png" width="2000" class="r-stretch"></section>
<section id="a-more-simple-ggplot2-method-ggfp-packages" class="slide level2">
<h2>A more simple ggplot2 method: <code>ggfp</code> packages</h2>
<p><code>The goal of ggfp is to simplify the process of drawing forest plots using ggplot2</code>. We have packaged the main code for drawing forest plots to form the gg_fp() function. gg_fp() has the advantage that only a few parameters need to be provided to draw a nice forest plot. Of course, it also has the obvious disadvantage that some of the more fine-grained graph adjustment parameters are not available in gg_fp().</p>
<hr>
<p><br> You can install the development version of ggfp like so:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb26"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb26-1"><a href="#cb26-1"></a>devtools<span class="sc">::</span><span class="fu">install_github</span>(<span class="st">'lizhiwei1994/ggfp'</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div>
</section>
<section id="creat-forestplot-using-ggfp-package" class="slide level2">
<h2>Creat forestplot using <code>ggfp</code> package</h2>
<div class="cell" data-fig.dim="[10,4]">
<details>
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb27"><pre class="sourceCode numberSource r number-lines code-with-copy"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1"></a><span class="fu">ggplot</span>(dat2, <span class="fu">aes</span>(<span class="at">x =</span> Disease, <span class="at">y =</span> PC, <span class="at">shape =</span> group, <span class="at">fill =</span> group, <span class="at">colour =</span> group, <span class="at">group =</span> group)) <span class="sc">+</span></span>
<span id="cb27-2"><a href="#cb27-2"></a><span class="fu">geom_hline</span>(<span class="at">yintercept =</span> <span class="dv">0</span>, <span class="at">linetype =</span> <span class="st">"dashed"</span>, <span class="at">colour =</span> <span class="st">"black"</span>, <span class="at">size =</span> <span class="fl">0.5</span>) <span class="sc">+</span></span>
<span id="cb27-3"><a href="#cb27-3"></a><span class="fu">geom_point</span>(<span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">size =</span> <span class="dv">2</span>) <span class="sc">+</span></span>
<span id="cb27-4"><a href="#cb27-4"></a><span class="fu">geom_errorbar</span>(<span class="fu">aes</span>(<span class="at">ymin =</span> PC_95_LOW, <span class="at">ymax =</span> PC_95_UP), <span class="at">position =</span> <span class="fu">position_dodge</span>(.<span class="dv">7</span>), <span class="at">width =</span> <span class="fl">0.3</span>, <span class="at">size =</span> <span class="fl">0.6</span>) <span class="sc">+</span></span>
<span id="cb27-5"><a href="#cb27-5"></a><span class="fu">scale_y_continuous</span>(<span class="st">"Percentage Change (%) and 95% CI"</span>, <span class="at">labels =</span> scales<span class="sc">::</span><span class="fu">number_format</span>(<span class="at">accuracy =</span> <span class="fl">0.01</span>))<span class="sc">+</span></span>
<span id="cb27-6"><a href="#cb27-6"></a><span class="fu">scale_shape_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="dv">16</span>, <span class="dv">23</span>, <span class="dv">24</span>, <span class="dv">15</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb27-7"><a href="#cb27-7"></a><span class="fu">scale_fill_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb27-8"><a href="#cb27-8"></a><span class="fu">scale_colour_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"#ea4a50"</span>, <span class="st">"#325788"</span>, <span class="st">"dodgerblue"</span>, <span class="st">"coral1"</span>), <span class="at">guide =</span> <span class="fu">guide_legend</span>(<span class="at">title =</span> <span class="cn">NULL</span>)) <span class="sc">+</span></span>
<span id="cb27-9"><a href="#cb27-9"></a><span class="fu">theme_bw</span>() <span class="sc">+</span></span>
<span id="cb27-10"><a href="#cb27-10"></a> <span class="fu">theme</span>(<span class="at">panel.grid.major =</span> <span class="fu">element_blank</span>(), <span class="at">panel.grid.minor =</span> <span class="fu">element_blank</span>()) <span class="sc">+</span></span>
<span id="cb27-11"><a href="#cb27-11"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"top"</span>) <span class="sc">+</span> </span>
<span id="cb27-12"><a href="#cb27-12"></a> <span class="fu">theme</span>(<span class="at">legend.key =</span> <span class="fu">element_blank</span>()) <span class="sc">+</span></span>
<span id="cb27-13"><a href="#cb27-13"></a> <span class="fu">theme</span>(<span class="at">legend.background =</span> <span class="fu">element_rect</span>(<span class="at">fill =</span> <span class="st">"white"</span>, <span class="at">colour =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb27-14"><a href="#cb27-14"></a> <span class="fu">theme</span>(<span class="at">legend.text =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">10</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb27-15"><a href="#cb27-15"></a> <span class="fu">theme</span>(<span class="at">legend.key.height =</span> <span class="fu">unit</span>(<span class="fl">0.3</span>, <span class="st">"cm"</span>)) <span class="sc">+</span></span>
<span id="cb27-16"><a href="#cb27-16"></a> <span class="fu">theme</span>(<span class="at">axis.text.y =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">12</span>, <span class="at">angle =</span> <span class="dv">0</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb27-17"><a href="#cb27-17"></a> <span class="fu">theme</span>(<span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">12</span>, <span class="at">color =</span> <span class="st">"black"</span>)) <span class="sc">+</span></span>
<span id="cb27-18"><a href="#cb27-18"></a> <span class="fu">xlab</span>(<span class="st">""</span>) <span class="sc">+</span></span>
<span id="cb27-19"><a href="#cb27-19"></a> <span class="fu">facet_wrap</span>(<span class="fu">vars</span>(country))</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>