-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1950 lines (1500 loc) · 403 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="" xml:lang="">
<head>
<title>Why R? Webinar 037</title>
<meta charset="utf-8" />
<meta name="author" content="David Gohel" />
<meta name="date" content="2021-03-11" />
<script src="static/libs/header-attrs-2.7.3/header-attrs.js"></script>
<link href="static/libs/remark-css-0.0.1/default.css" rel="stylesheet" />
<link href="static/libs/tabwid-1.0.0/tabwid.css" rel="stylesheet" />
<link rel="stylesheet" href="static/assets/css/bg-open-color.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/font-open-color.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/text-rect.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/roboto.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/roboto-mono.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/permanent-marker.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/flexboxgrid.min.css" type="text/css" />
<link rel="stylesheet" href="static/ardata-remark.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/nord.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/nord-light.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/nord-dark.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/card.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/abs-layout.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/spaces.css" type="text/css" />
<link rel="stylesheet" href="static/assets/css/quasar.min.css" type="text/css" />
</head>
<body>
<textarea id="source">
class: center, middle, inverse, title-slide
# Why R? Webinar 037
## Tabular reporting with the flextable package
### David Gohel
### 2021-03-11
---
# About me
.pull-left[
.center[
Me and my family
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512" class="rfa" style="height:3.4em;fill:#C32900;position:relative;"><path d="M96 0c35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64S60.654 0 96 0m48 144h-11.36c-22.711 10.443-49.59 10.894-73.28 0H48c-26.51 0-48 21.49-48 48v136c0 13.255 10.745 24 24 24h16v136c0 13.255 10.745 24 24 24h64c13.255 0 24-10.745 24-24V352h16c13.255 0 24-10.745 24-24V192c0-26.51-21.49-48-48-48z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" class="rfa" style="height:3.4em;fill:currentColor;position:relative;"><path d="M128 0c35.346 0 64 28.654 64 64s-28.654 64-64 64c-35.346 0-64-28.654-64-64S92.654 0 128 0m119.283 354.179l-48-192A24 24 0 0 0 176 144h-11.36c-22.711 10.443-49.59 10.894-73.28 0H80a24 24 0 0 0-23.283 18.179l-48 192C4.935 369.305 16.383 384 32 384h56v104c0 13.255 10.745 24 24 24h32c13.255 0 24-10.745 24-24V384h56c15.591 0 27.071-14.671 23.283-29.821z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" class="rfa" style="height:2.4em;fill:currentColor;position:relative;"><path d="M120 72c0-39.765 32.235-72 72-72s72 32.235 72 72c0 39.764-32.235 72-72 72s-72-32.236-72-72zm254.627 1.373c-12.496-12.497-32.758-12.497-45.254 0L242.745 160H141.254L54.627 73.373c-12.496-12.497-32.758-12.497-45.254 0-12.497 12.497-12.497 32.758 0 45.255L104 213.254V480c0 17.673 14.327 32 32 32h16c17.673 0 32-14.327 32-32V368h16v112c0 17.673 14.327 32 32 32h16c17.673 0 32-14.327 32-32V213.254l94.627-94.627c12.497-12.497 12.497-32.757 0-45.254z"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" class="rfa" style="height:1.6em;fill:currentColor;position:relative;"><path d="M192 160c44.2 0 80-35.8 80-80S236.2 0 192 0s-80 35.8-80 80 35.8 80 80 80zm-53.4 248.8l25.6-32-61.5-51.2L56.8 383c-11.4 14.2-11.7 34.4-.8 49l48 64c7.9 10.5 19.9 16 32 16 8.3 0 16.8-2.6 24-8 17.7-13.2 21.2-38.3 8-56l-29.4-39.2zm142.7-83.2l-61.5 51.2 25.6 32L216 448c-13.2 17.7-9.7 42.8 8 56 7.2 5.4 15.6 8 24 8 12.2 0 24.2-5.5 32-16l48-64c10.9-14.6 10.6-34.8-.8-49l-45.9-57.4zM376.7 145c-12.7-18.1-37.6-22.4-55.7-9.8l-40.6 28.5c-52.7 37-124.2 37-176.8 0L63 135.3C44.9 122.6 20 127 7.3 145-5.4 163.1-1 188 17 200.7l40.6 28.5c17 11.9 35.4 20.9 54.4 27.9V288h160v-30.8c19-7 37.4-16 54.4-27.9l40.6-28.5c18.1-12.8 22.4-37.7 9.7-55.8z"/></svg>
Some of my open source
[<img src="static/assets/img/ggiraphlogo.svg" style="height:3.5em;">](https://CRAN.R-project.org/package=ggiraph) [<img src="static/assets/img/officerlogo.svg" style="height:3.5em;">](https://CRAN.R-project.org/package=officer) [<img src="static/assets/img/flextable-logo.png" style="height:3.5em;">](https://CRAN.R-project.org/package=flextable) [<img src="static/assets/img/logo-officedown.svg" style="height:3.5em;">](https://CRAN.R-project.org/package=officedown) [<img src="static/assets/img/logo-fpeek.svg" style="height:3.5em;">](https://CRAN.R-project.org/package=fpeek)
Funder of
![](static/assets/img/ardata-logo-medium.svg)
Based in Paris, France
]
]
.pull-right[
[at https://www.ardata.fr](https://www.ardata.fr)
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" class="rfa" style="height:1.7em;fill:currentColor;position:relative;"><path d="M610.5 341.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 368.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm224 32c1.9 0 3.7-.5 5.6-.6 8.3-21.7 20.5-42.1 36.3-59.2 7.4-8 17.9-12.6 28.9-12.6 6.9 0 13.7 1.8 19.6 5.3l7.9 4.6c.8-.5 1.6-.9 2.4-1.4 7-14.6 11.2-30.8 11.2-48 0-61.9-50.1-112-112-112S208 82.1 208 144c0 61.9 50.1 112 112 112zm105.2 194.5c-2.3-1.2-4.6-2.6-6.8-3.9-8.2 4.8-15.3 9.8-27.5 9.8-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-10.7-34.5 24.9-49.7 25.8-50.3-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-3.8-2.2-7-5-9.8-8.1-3.3.2-6.5.6-9.8.6-24.6 0-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h255.4c-3.7-6-6.2-12.8-6.2-20.3v-9.2zM173.1 274.6C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"/></svg> With Clémentine and Panagiotis
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 581 512" class="rfa" style="height:1.7em;fill:currentColor;position:relative;"><path d="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"/></svg> package development, deploiement, support, migration, shiny development
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="rfa" style="height:1.7em;fill:currentColor;position:relative;"><path d="M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"/></svg> scientific cloud computing environment (jupyterhub, RStudio, ...)
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" class="rfa" style="height:1.7em;fill:currentColor;position:relative;"><path d="M208 352c-2.39 0-4.78.35-7.06 1.09C187.98 357.3 174.35 360 160 360c-14.35 0-27.98-2.7-40.95-6.91-2.28-.74-4.66-1.09-7.05-1.09C49.94 352-.33 402.48 0 464.62.14 490.88 21.73 512 48 512h224c26.27 0 47.86-21.12 48-47.38.33-62.14-49.94-112.62-112-112.62zm-48-32c53.02 0 96-42.98 96-96s-42.98-96-96-96-96 42.98-96 96 42.98 96 96 96zM592 0H208c-26.47 0-48 22.25-48 49.59V96c23.42 0 45.1 6.78 64 17.8V64h352v288h-64v-64H384v64h-76.24c19.1 16.69 33.12 38.73 39.69 64H592c26.47 0 48-22.25 48-49.59V49.59C640 22.25 618.47 0 592 0z"/></svg> R Trainings
]
---
class: middle, center
# Short introduction to ![](static/assets/img/flextable-logo.png)
---
## Why flextable?
* Tables, just like graphs, can be a very good way to provide
synthetic and clear information.
* They are easy to read by our public.
* They must be easy to produce from R.
* My customers always ask for nice tables, in Word, PowerPoint
or HTML (not so much for PDF).
---
## Package overview
.card.noborder[
.card.width-50[
.section[**1 - Extensive formatting capabilities**]
.section.font-sm[
The package offers a flexible and rich syntax allowing:
* merging cells,
* add header lines,
* change formats,
* modify the display of the data in the table .
.hline[]
.font-sm[
plus mix text, images, ggplot, hyperlinks
]
]
]
.card.width-46[
.section[**2 - Publication-Quality**]
.section.font-sm[
.font-sm[
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="rfa" style="height:1.1em;fill:#C32900;position:relative;"><path d="M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z"/></svg> Support for caption and cross-references in HTML, Word and PDF
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" class="rfa" style="height:1.1em;fill:#C32900;position:relative;"><path d="M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"/></svg> Everything can be coded, no "copy paste your table"
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="rfa" style="height:1.1em;fill:#C32900;position:relative;"><path d="M475.115 163.781L336 252.309v-68.28c0-18.916-20.931-30.399-36.885-20.248L160 252.309V56c0-13.255-10.745-24-24-24H24C10.745 32 0 42.745 0 56v400c0 13.255 10.745 24 24 24h464c13.255 0 24-10.745 24-24V184.029c0-18.917-20.931-30.399-36.885-20.248z"/></svg> Already used by CRO,
pharmaceutical companies, public health institutes, ...
]
]
]
.card.width-36[
.section[**3 - Static tables**]
.section.font-sm[
A flextable is a static table that shows the data contained in a **data.frame**,
.hline[]
.font-sm[
or that shows a view of data transformed by **as_flextable**.
]
]
]
.card.width-30[
.section[**4 - Supported outputs**]
.section.font-sm[
![](static/assets/img/fig_formats.png)
.hline[]
.font-sm[
&#43; support for png output via webshot
]
]
]
.card.width-28[
.section[**5 - Documentation**]
.section.font-sm[
A detailed&nbsp;<a href="https://ardata-fr.github.io/flextable-book/">documentation</a> with many illustrations is available, made with
<img src="static/assets/img/bookdown-logo.png" style="width:75px;">
]
]
]
---
## History
.bigul[
* **2017-03-28**: first realease on CRAN, support officer and HTML R Markdown.
Idea was to replace `ReporteRs::FlexTable`.
* **2017-10-30**: Merge pull request #37 from mnazarov/master.
Added functionality to insert flextable's in R Markdown for docx output.
* **2017-11-22**: R Markdown support for pptx output.
* **2019-01-29**: Refactor internals and add `flextable::compose` (for complex formatting)
]
![](static/assets/img/fusee.png)
---
## A first example
```r
flextable(airquality[ sample.int(5),]) %>%
add_header_row(colwidths = c(4, 2), values = c("Air quality", "Time")) %>%
theme_vanilla() %>%
add_footer_lines("Daily measurements in New York, May to September 1973.") %>%
color(part = "footer", color = "#666666") %>%
set_caption(caption = "New York Air Quality Measurements")
```
<template id="a6f2d03d-201f-4e8c-b960-21e7b5de839f"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c0bfe050{border-collapse:collapse;}.cl-c0b91892{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0b918c4{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0b93ad4{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c0b93ae8{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c0b982f0{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0b98304{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0b9830e{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0b98318{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0b98322{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c0bfe050'><caption class="Table Caption">New York Air Quality Measurements</caption><thead><tr style="overflow-wrap:break-word;"><td colspan="4"class="cl-c0b98322"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Air quality</span></p></td><td colspan="2"class="cl-c0b98322"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Time</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Ozone</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Solar.R</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Wind</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Temp</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Month</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b91892">Day</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c0b982f0"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">41</span></p></td><td class="cl-c0b982f0"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">190</span></p></td><td class="cl-c0b982f0"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">7.4</span></p></td><td class="cl-c0b982f0"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">67</span></p></td><td class="cl-c0b982f0"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">5</span></p></td><td class="cl-c0b982f0"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">36</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">118</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">8.0</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">72</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">5</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">18</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">313</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">11.5</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">62</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">5</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">4</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">12</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">149</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">12.6</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">74</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">5</span></p></td><td class="cl-c0b98304"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">3</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">&lt;na&gt;</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">&lt;na&gt;</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">14.3</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">56</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">5</span></p></td><td class="cl-c0b9830e"><p class="cl-c0b93ad4"><span class="cl-c0b918c4">5</span></p></td></tr></tbody><tfoot><tr style="overflow-wrap:break-word;"><td colspan="6"class="cl-c0b98318"><p class="cl-c0b93ae8"><span class="cl-c0b918c4">Daily measurements in New York, May to September 1973.</span></p></td></tr></tfoot></table></div></template>
<div class="flextable-shadow-host" id="8796fe1d-fa7c-43a7-aae2-936b691716da"></div>
<script>
var dest = document.getElementById("8796fe1d-fa7c-43a7-aae2-936b691716da");
var template = document.getElementById("a6f2d03d-201f-4e8c-b960-21e7b5de839f");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
---
class: center, middle
# Principles
---
## Parts of a flextable
A flextable is composed of 3 parts:
.pull-left[
![](static/assets/img/flextable_layout.png)
]
.pull-right[
**header**: by default, there is only one line containing
the names of the data.frame columns.
**body**: contains the data from the data.frame.
**footer**: by default, this part is not available, but it
may contain footnotes and any other content.
.oc-bg-gray-0[part=all] <==> .oc-bg-pink-3[header + body + footer]
]
---
## Columns to display
.pull-left[
* The `col_keys` argument of the `flextable` function allows to select the columns
of the data.frame to be displayed.
* The other columns can however be used later.
* If a column is filled in the argument but does not exist, an empty column will
be created.
]
.pull-right[
```r
dat <- head(airquality, n = 3)
flextable(dat)
```
<template id="92a700a3-b05c-40ad-bb1c-5750e1f85bae"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c0d19b24{border-collapse:collapse;}.cl-c0cc450c{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0cc452a{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0cc5218{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c0cc77ac{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0cc77c0{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0cc77ca{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0cc77d4{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c0d19b24'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c0cc77d4"><p class="cl-c0cc5218"><span class="cl-c0cc450c">Ozone</span></p></td><td class="cl-c0cc77d4"><p class="cl-c0cc5218"><span class="cl-c0cc450c">Solar.R</span></p></td><td class="cl-c0cc77d4"><p class="cl-c0cc5218"><span class="cl-c0cc450c">Wind</span></p></td><td class="cl-c0cc77d4"><p class="cl-c0cc5218"><span class="cl-c0cc450c">Temp</span></p></td><td class="cl-c0cc77d4"><p class="cl-c0cc5218"><span class="cl-c0cc450c">Month</span></p></td><td class="cl-c0cc77d4"><p class="cl-c0cc5218"><span class="cl-c0cc450c">Day</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c0cc77ac"><p class="cl-c0cc5218"><span class="cl-c0cc452a">41</span></p></td><td class="cl-c0cc77ac"><p class="cl-c0cc5218"><span class="cl-c0cc452a">190</span></p></td><td class="cl-c0cc77ac"><p class="cl-c0cc5218"><span class="cl-c0cc452a">7.4</span></p></td><td class="cl-c0cc77ac"><p class="cl-c0cc5218"><span class="cl-c0cc452a">67</span></p></td><td class="cl-c0cc77ac"><p class="cl-c0cc5218"><span class="cl-c0cc452a">5</span></p></td><td class="cl-c0cc77ac"><p class="cl-c0cc5218"><span class="cl-c0cc452a">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0cc77c0"><p class="cl-c0cc5218"><span class="cl-c0cc452a">36</span></p></td><td class="cl-c0cc77c0"><p class="cl-c0cc5218"><span class="cl-c0cc452a">118</span></p></td><td class="cl-c0cc77c0"><p class="cl-c0cc5218"><span class="cl-c0cc452a">8.0</span></p></td><td class="cl-c0cc77c0"><p class="cl-c0cc5218"><span class="cl-c0cc452a">72</span></p></td><td class="cl-c0cc77c0"><p class="cl-c0cc5218"><span class="cl-c0cc452a">5</span></p></td><td class="cl-c0cc77c0"><p class="cl-c0cc5218"><span class="cl-c0cc452a">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0cc77ca"><p class="cl-c0cc5218"><span class="cl-c0cc452a">12</span></p></td><td class="cl-c0cc77ca"><p class="cl-c0cc5218"><span class="cl-c0cc452a">149</span></p></td><td class="cl-c0cc77ca"><p class="cl-c0cc5218"><span class="cl-c0cc452a">12.6</span></p></td><td class="cl-c0cc77ca"><p class="cl-c0cc5218"><span class="cl-c0cc452a">74</span></p></td><td class="cl-c0cc77ca"><p class="cl-c0cc5218"><span class="cl-c0cc452a">5</span></p></td><td class="cl-c0cc77ca"><p class="cl-c0cc5218"><span class="cl-c0cc452a">3</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="7364aeb4-5ee6-4a78-a329-68d41c53bf48"></div>
<script>
var dest = document.getElementById("7364aeb4-5ee6-4a78-a329-68d41c53bf48");
var template = document.getElementById("92a700a3-b05c-40ad-bb1c-5750e1f85bae");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
.pull-left[
```r
flextable(data = dat,
col_keys = c("Ozone", "Temp",
"Month", "Day"))
```
<template id="608f0cee-8dbd-4497-a571-87179d296e3c"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c0e4f264{border-collapse:collapse;}.cl-c0dbb280{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0dbb29e{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0dbbfdc{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c0dbe4d0{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0dbe4e4{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0dbe4ee{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0dbe4f8{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c0e4f264'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c0dbe4f8"><p class="cl-c0dbbfdc"><span class="cl-c0dbb280">Ozone</span></p></td><td class="cl-c0dbe4f8"><p class="cl-c0dbbfdc"><span class="cl-c0dbb280">Temp</span></p></td><td class="cl-c0dbe4f8"><p class="cl-c0dbbfdc"><span class="cl-c0dbb280">Month</span></p></td><td class="cl-c0dbe4f8"><p class="cl-c0dbbfdc"><span class="cl-c0dbb280">Day</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c0dbe4d0"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">41</span></p></td><td class="cl-c0dbe4d0"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">67</span></p></td><td class="cl-c0dbe4d0"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">5</span></p></td><td class="cl-c0dbe4d0"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0dbe4e4"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">36</span></p></td><td class="cl-c0dbe4e4"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">72</span></p></td><td class="cl-c0dbe4e4"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">5</span></p></td><td class="cl-c0dbe4e4"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0dbe4ee"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">12</span></p></td><td class="cl-c0dbe4ee"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">74</span></p></td><td class="cl-c0dbe4ee"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">5</span></p></td><td class="cl-c0dbe4ee"><p class="cl-c0dbbfdc"><span class="cl-c0dbb29e">3</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="7149b712-07b1-4bcd-8df8-dcc5fe91d97c"></div>
<script>
var dest = document.getElementById("7149b712-07b1-4bcd-8df8-dcc5fe91d97c");
var template = document.getElementById("608f0cee-8dbd-4497-a571-87179d296e3c");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
.pull-right[
```r
flextable(data = dat,
col_keys = c("Month", "Day",
"dummy", "Ozone"))
```
<template id="1c8afb9a-c2ba-473f-99e3-609140abbe8c"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c0f50dde{border-collapse:collapse;}.cl-c0ef8ca6{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0ef8cba{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c0ef9a52{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c0ef9a66{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c0efc45a{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc46e{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc478{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc482{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc483{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc48c{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc496{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c0efc497{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c0f50dde'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c0efc496"><p class="cl-c0ef9a52"><span class="cl-c0ef8ca6">Month</span></p></td><td class="cl-c0efc496"><p class="cl-c0ef9a52"><span class="cl-c0ef8ca6">Day</span></p></td><td class="cl-c0efc497"><p class="cl-c0ef9a66"><span class="cl-c0ef8ca6"></span></p></td><td class="cl-c0efc496"><p class="cl-c0ef9a52"><span class="cl-c0ef8ca6">Ozone</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c0efc45a"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">5</span></p></td><td class="cl-c0efc45a"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">1</span></p></td><td class="cl-c0efc46e"><p class="cl-c0ef9a66"><span class="cl-c0ef8cba"></span></p></td><td class="cl-c0efc45a"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">41</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0efc478"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">5</span></p></td><td class="cl-c0efc478"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">2</span></p></td><td class="cl-c0efc482"><p class="cl-c0ef9a66"><span class="cl-c0ef8cba"></span></p></td><td class="cl-c0efc478"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">36</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c0efc483"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">5</span></p></td><td class="cl-c0efc483"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">3</span></p></td><td class="cl-c0efc48c"><p class="cl-c0ef9a66"><span class="cl-c0ef8cba"></span></p></td><td class="cl-c0efc483"><p class="cl-c0ef9a52"><span class="cl-c0ef8cba">12</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="ca370d9b-170c-4051-9eee-31024554c3da"></div>
<script>
var dest = document.getElementById("ca370d9b-170c-4051-9eee-31024554c3da");
var template = document.getElementById("1c8afb9a-c2ba-473f-99e3-609140abbe8c");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
---
## Selectors
.pull-left[
**Selectors** let you select rows and or columns where operations will be applied.
They are available to format (change color, background color, borders), define
the content of the cells, merge cells, ...
The `i` selector corresponds to the rows and the `j` selector corresponds to the columns. They can be expressed in different ways:
* as a formula: `i = ~ col %in% "xxx"`, `j = ~ col1 + col2`.
* as a character vector: `j = c("x", "y")`.
* as an integer vector: `i = 1:3`, `j = 1:3`.
* as a logical vector: `i = c(TRUE, FALSE)`, `j = c(TRUE, FALSE)`.
]
.pull-right[
```r
ft <- flextable(dat)
ft %>%
color(
* i = ~ Ozone < 40,
* j = c("Ozone", "Solar.R"),
color = "orange")
```
<template id="41e6beb2-e097-4abd-bf9b-bdc6d2356a4e"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c1068ee2{border-collapse:collapse;}.cl-c101b0de{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c101b0fc{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c101b106{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(255, 165, 0, 1.00);background-color:transparent;}.cl-c101be80{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c101e536{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c101e54a{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c101e554{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c101e55e{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c1068ee2'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c101e55e"><p class="cl-c101be80"><span class="cl-c101b0de">Ozone</span></p></td><td class="cl-c101e55e"><p class="cl-c101be80"><span class="cl-c101b0de">Solar.R</span></p></td><td class="cl-c101e55e"><p class="cl-c101be80"><span class="cl-c101b0de">Wind</span></p></td><td class="cl-c101e55e"><p class="cl-c101be80"><span class="cl-c101b0de">Temp</span></p></td><td class="cl-c101e55e"><p class="cl-c101be80"><span class="cl-c101b0de">Month</span></p></td><td class="cl-c101e55e"><p class="cl-c101be80"><span class="cl-c101b0de">Day</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c101e536"><p class="cl-c101be80"><span class="cl-c101b0fc">41</span></p></td><td class="cl-c101e536"><p class="cl-c101be80"><span class="cl-c101b0fc">190</span></p></td><td class="cl-c101e536"><p class="cl-c101be80"><span class="cl-c101b0fc">7.4</span></p></td><td class="cl-c101e536"><p class="cl-c101be80"><span class="cl-c101b0fc">67</span></p></td><td class="cl-c101e536"><p class="cl-c101be80"><span class="cl-c101b0fc">5</span></p></td><td class="cl-c101e536"><p class="cl-c101be80"><span class="cl-c101b0fc">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c101e54a"><p class="cl-c101be80"><span class="cl-c101b106">36</span></p></td><td class="cl-c101e54a"><p class="cl-c101be80"><span class="cl-c101b106">118</span></p></td><td class="cl-c101e54a"><p class="cl-c101be80"><span class="cl-c101b0fc">8.0</span></p></td><td class="cl-c101e54a"><p class="cl-c101be80"><span class="cl-c101b0fc">72</span></p></td><td class="cl-c101e54a"><p class="cl-c101be80"><span class="cl-c101b0fc">5</span></p></td><td class="cl-c101e54a"><p class="cl-c101be80"><span class="cl-c101b0fc">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c101e554"><p class="cl-c101be80"><span class="cl-c101b106">12</span></p></td><td class="cl-c101e554"><p class="cl-c101be80"><span class="cl-c101b106">149</span></p></td><td class="cl-c101e554"><p class="cl-c101be80"><span class="cl-c101b0fc">12.6</span></p></td><td class="cl-c101e554"><p class="cl-c101be80"><span class="cl-c101b0fc">74</span></p></td><td class="cl-c101e554"><p class="cl-c101be80"><span class="cl-c101b0fc">5</span></p></td><td class="cl-c101e554"><p class="cl-c101be80"><span class="cl-c101b0fc">3</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="1e795d5f-1b45-4ab4-b126-be613412934f"></div>
<script>
var dest = document.getElementById("1e795d5f-1b45-4ab4-b126-be613412934f");
var template = document.getElementById("41e6beb2-e097-4abd-bf9b-bdc6d2356a4e");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
---
## Cell content
By default, the cells of the flextable are filled with
the content of the data.frame cells.
.pull-left[
```r
ft <- flextable(dat)
ft
```
<template id="02fe4e00-ac34-4c1a-a133-ca986ab9322d"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c1187a30{border-collapse:collapse;}.cl-c112fede{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c112fefc{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c1130cc6{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c11334d0{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c11334ee{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c11334f8{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c11334f9{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c1187a30'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c11334f9"><p class="cl-c1130cc6"><span class="cl-c112fede">Ozone</span></p></td><td class="cl-c11334f9"><p class="cl-c1130cc6"><span class="cl-c112fede">Solar.R</span></p></td><td class="cl-c11334f9"><p class="cl-c1130cc6"><span class="cl-c112fede">Wind</span></p></td><td class="cl-c11334f9"><p class="cl-c1130cc6"><span class="cl-c112fede">Temp</span></p></td><td class="cl-c11334f9"><p class="cl-c1130cc6"><span class="cl-c112fede">Month</span></p></td><td class="cl-c11334f9"><p class="cl-c1130cc6"><span class="cl-c112fede">Day</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c11334d0"><p class="cl-c1130cc6"><span class="cl-c112fefc">41</span></p></td><td class="cl-c11334d0"><p class="cl-c1130cc6"><span class="cl-c112fefc">190</span></p></td><td class="cl-c11334d0"><p class="cl-c1130cc6"><span class="cl-c112fefc">7.4</span></p></td><td class="cl-c11334d0"><p class="cl-c1130cc6"><span class="cl-c112fefc">67</span></p></td><td class="cl-c11334d0"><p class="cl-c1130cc6"><span class="cl-c112fefc">5</span></p></td><td class="cl-c11334d0"><p class="cl-c1130cc6"><span class="cl-c112fefc">1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c11334ee"><p class="cl-c1130cc6"><span class="cl-c112fefc">36</span></p></td><td class="cl-c11334ee"><p class="cl-c1130cc6"><span class="cl-c112fefc">118</span></p></td><td class="cl-c11334ee"><p class="cl-c1130cc6"><span class="cl-c112fefc">8.0</span></p></td><td class="cl-c11334ee"><p class="cl-c1130cc6"><span class="cl-c112fefc">72</span></p></td><td class="cl-c11334ee"><p class="cl-c1130cc6"><span class="cl-c112fefc">5</span></p></td><td class="cl-c11334ee"><p class="cl-c1130cc6"><span class="cl-c112fefc">2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c11334f8"><p class="cl-c1130cc6"><span class="cl-c112fefc">12</span></p></td><td class="cl-c11334f8"><p class="cl-c1130cc6"><span class="cl-c112fefc">149</span></p></td><td class="cl-c11334f8"><p class="cl-c1130cc6"><span class="cl-c112fefc">12.6</span></p></td><td class="cl-c11334f8"><p class="cl-c1130cc6"><span class="cl-c112fefc">74</span></p></td><td class="cl-c11334f8"><p class="cl-c1130cc6"><span class="cl-c112fefc">5</span></p></td><td class="cl-c11334f8"><p class="cl-c1130cc6"><span class="cl-c112fefc">3</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="ea0858ae-7f20-407a-8b44-aa67935ace52"></div>
<script>
var dest = document.getElementById("ea0858ae-7f20-407a-8b44-aa67935ace52");
var template = document.getElementById("02fe4e00-ac34-4c1a-a133-ca986ab9322d");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
```r
ft <- colformat_double(ft, digits = 2) %>%
colformat_int(prefix = "#")
ft
```
<template id="b7ff9bc7-f44a-460d-9be9-6e230931f59f"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c125c8ca{border-collapse:collapse;}.cl-c12056d8{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c12056f6{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c12064b6{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c1208bc6{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1208bda{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1208be4{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1208bee{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c125c8ca'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c1208bee"><p class="cl-c12064b6"><span class="cl-c12056d8">Ozone</span></p></td><td class="cl-c1208bee"><p class="cl-c12064b6"><span class="cl-c12056d8">Solar.R</span></p></td><td class="cl-c1208bee"><p class="cl-c12064b6"><span class="cl-c12056d8">Wind</span></p></td><td class="cl-c1208bee"><p class="cl-c12064b6"><span class="cl-c12056d8">Temp</span></p></td><td class="cl-c1208bee"><p class="cl-c12064b6"><span class="cl-c12056d8">Month</span></p></td><td class="cl-c1208bee"><p class="cl-c12064b6"><span class="cl-c12056d8">Day</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c1208bc6"><p class="cl-c12064b6"><span class="cl-c12056f6">#41</span></p></td><td class="cl-c1208bc6"><p class="cl-c12064b6"><span class="cl-c12056f6">#190</span></p></td><td class="cl-c1208bc6"><p class="cl-c12064b6"><span class="cl-c12056f6">7.40</span></p></td><td class="cl-c1208bc6"><p class="cl-c12064b6"><span class="cl-c12056f6">#67</span></p></td><td class="cl-c1208bc6"><p class="cl-c12064b6"><span class="cl-c12056f6">#5</span></p></td><td class="cl-c1208bc6"><p class="cl-c12064b6"><span class="cl-c12056f6">#1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c1208bda"><p class="cl-c12064b6"><span class="cl-c12056f6">#36</span></p></td><td class="cl-c1208bda"><p class="cl-c12064b6"><span class="cl-c12056f6">#118</span></p></td><td class="cl-c1208bda"><p class="cl-c12064b6"><span class="cl-c12056f6">8.00</span></p></td><td class="cl-c1208bda"><p class="cl-c12064b6"><span class="cl-c12056f6">#72</span></p></td><td class="cl-c1208bda"><p class="cl-c12064b6"><span class="cl-c12056f6">#5</span></p></td><td class="cl-c1208bda"><p class="cl-c12064b6"><span class="cl-c12056f6">#2</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c1208be4"><p class="cl-c12064b6"><span class="cl-c12056f6">#12</span></p></td><td class="cl-c1208be4"><p class="cl-c12064b6"><span class="cl-c12056f6">#149</span></p></td><td class="cl-c1208be4"><p class="cl-c12064b6"><span class="cl-c12056f6">12.60</span></p></td><td class="cl-c1208be4"><p class="cl-c12064b6"><span class="cl-c12056f6">#74</span></p></td><td class="cl-c1208be4"><p class="cl-c12064b6"><span class="cl-c12056f6">#5</span></p></td><td class="cl-c1208be4"><p class="cl-c12064b6"><span class="cl-c12056f6">#3</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="a89543a1-7a8a-4a5d-b69a-befdf5f48c23"></div>
<script>
var dest = document.getElementById("a89543a1-7a8a-4a5d-b69a-befdf5f48c23");
var template = document.getElementById("b7ff9bc7-f44a-460d-9be9-6e230931f59f");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
.pull-right[
You can change the displayed content of a cell with the following functions :
* `colformat_double`, to define how to display `double` columns,
* `colformat_int`, to define how to display `int` columns,
* `colformat_char`, to define how to display `character` columns,
* `colformat_datetime()` & `colformat_date()`,
* `colformat_image()`,
* `colformat_lgl()`,
* `colformat_num()`
]
---
## Cell with multi-content
The cells of the flextable are filled with more than a *content*.
.pull-left[
```r
ft <- flextable(dat,
col_keys = c("Month", "Day", "Solar.R"))
ft <- compose(ft,
j = "Solar.R",
* value = as_paragraph(
* Solar.R, " (", as_b(Ozone), ")"
* )
)
ft
```
<template id="8e2fb071-5488-4c39-9de5-dd35d7ab6f96"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c136ba40{border-collapse:collapse;}.cl-c131c8fa{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c131c918{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c131d728{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c131fbfe{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c131fc12{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c131fc1c{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c131fc26{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c136ba40'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c131fc26"><p class="cl-c131d728"><span class="cl-c131c8fa">Month</span></p></td><td class="cl-c131fc26"><p class="cl-c131d728"><span class="cl-c131c8fa">Day</span></p></td><td class="cl-c131fc26"><p class="cl-c131d728"><span class="cl-c131c8fa">Solar.R</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c131fbfe"><p class="cl-c131d728"><span class="cl-c131c918">5</span></p></td><td class="cl-c131fbfe"><p class="cl-c131d728"><span class="cl-c131c918">1</span></p></td><td class="cl-c131fbfe"><p class="cl-c131d728"><span class="cl-c131c918">190</span><span class="cl-c131c918"> (</span><span class="cl-c131c8fa">41</span><span class="cl-c131c918">)</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c131fc12"><p class="cl-c131d728"><span class="cl-c131c918">5</span></p></td><td class="cl-c131fc12"><p class="cl-c131d728"><span class="cl-c131c918">2</span></p></td><td class="cl-c131fc12"><p class="cl-c131d728"><span class="cl-c131c918">118</span><span class="cl-c131c918"> (</span><span class="cl-c131c8fa">36</span><span class="cl-c131c918">)</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c131fc1c"><p class="cl-c131d728"><span class="cl-c131c918">5</span></p></td><td class="cl-c131fc1c"><p class="cl-c131d728"><span class="cl-c131c918">3</span></p></td><td class="cl-c131fc1c"><p class="cl-c131d728"><span class="cl-c131c918">149</span><span class="cl-c131c918"> (</span><span class="cl-c131c8fa">12</span><span class="cl-c131c918">)</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="995a12c1-6606-436e-bbb5-f58968625d9b"></div>
<script>
var dest = document.getElementById("995a12c1-6606-436e-bbb5-f58968625d9b");
var template = document.getElementById("8e2fb071-5488-4c39-9de5-dd35d7ab6f96");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
.pull-right[
```r
ft <- compose(ft,
j = "Solar.R", i = 1, part = "header",
* value = as_paragraph(
* as_i("Solar"), " ",
* colorize(as_sup("R"), "red"))
)
ft
```
<template id="e29f08cf-5568-419b-b49f-b38143a6b419"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c142da8c{border-collapse:collapse;}.cl-c13d3988{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c13d39a6{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:italic;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c13d39b0{font-family:'Roboto';font-size:6.6pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(255, 0, 0, 1.00);background-color:transparent;position: relative;bottom:3.3pt;}.cl-c13d39ba{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c13d4798{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c13d6ad4{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c13d6ae8{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c13d6af2{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c13d6afc{width:54pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c142da8c'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c13d6afc"><p class="cl-c13d4798"><span class="cl-c13d3988">Month</span></p></td><td class="cl-c13d6afc"><p class="cl-c13d4798"><span class="cl-c13d3988">Day</span></p></td><td class="cl-c13d6afc"><p class="cl-c13d4798"><span class="cl-c13d39a6">Solar</span><span class="cl-c13d3988"> </span><span class="cl-c13d39b0">R</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c13d6ad4"><p class="cl-c13d4798"><span class="cl-c13d39ba">5</span></p></td><td class="cl-c13d6ad4"><p class="cl-c13d4798"><span class="cl-c13d39ba">1</span></p></td><td class="cl-c13d6ad4"><p class="cl-c13d4798"><span class="cl-c13d39ba">190</span><span class="cl-c13d39ba"> (</span><span class="cl-c13d3988">41</span><span class="cl-c13d39ba">)</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c13d6ae8"><p class="cl-c13d4798"><span class="cl-c13d39ba">5</span></p></td><td class="cl-c13d6ae8"><p class="cl-c13d4798"><span class="cl-c13d39ba">2</span></p></td><td class="cl-c13d6ae8"><p class="cl-c13d4798"><span class="cl-c13d39ba">118</span><span class="cl-c13d39ba"> (</span><span class="cl-c13d3988">36</span><span class="cl-c13d39ba">)</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c13d6af2"><p class="cl-c13d4798"><span class="cl-c13d39ba">5</span></p></td><td class="cl-c13d6af2"><p class="cl-c13d4798"><span class="cl-c13d39ba">3</span></p></td><td class="cl-c13d6af2"><p class="cl-c13d4798"><span class="cl-c13d39ba">149</span><span class="cl-c13d39ba"> (</span><span class="cl-c13d3988">12</span><span class="cl-c13d39ba">)</span></p></td></tr></tbody></table></div></template>
<div class="flextable-shadow-host" id="f0713bc5-d376-4d8f-9359-350fb47f6122"></div>
<script>
var dest = document.getElementById("f0713bc5-d376-4d8f-9359-350fb47f6122");
var template = document.getElementById("e29f08cf-5568-419b-b49f-b38143a6b419");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
]
---
## As flextable
Function `as_flextable` is a generic function to cast objects into flextable.
So far, this method exist for objects `lm`, `glm`, `mgcv::gam`, `xtable`, `htest`, `as_grouped_data`.
```r
dat <- attitude
dat$high.rating <- (dat$rating > 70)
probit.model <- glm(high.rating ~ learning + critical +
advance, data=dat, family = binomial(link = "probit"))
*ft <- as_flextable(probit.model)
ft
```
<template id="19b7d540-a80d-4d0e-8aa0-ee421826b798"><style>
.tabwid table{
border-collapse:collapse;
line-height:1;
margin-left:auto;
margin-right:auto;
border-width: 0;
display: table;
margin-top: 1.275em;
margin-bottom: 1.275em;
border-spacing: 0;
border-color: transparent;
}
.tabwid_left table{
margin-left:0;
}
.tabwid_right table{
margin-right:0;
}
.tabwid td {
padding: 0;
}
.tabwid a {
text-decoration: none;
}
.tabwid thead {
background-color: transparent;
}
.tabwid tfoot {
background-color: transparent;
}
.tabwid table tr {
background-color: transparent;
}
</style><div class="tabwid"><style>.cl-c1876044{border-collapse:collapse;}.cl-c17faf98{font-family:'Roboto';font-size:11pt;font-weight:bold;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c17fafb6{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:normal;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c17fafc0{font-family:'Roboto';font-size:11pt;font-weight:normal;font-style:italic;text-decoration:none;color:rgba(102, 102, 102, 1.00);background-color:transparent;}.cl-c17fc190{margin:0;text-align:left;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c17fc1a4{margin:0;text-align:right;border-bottom: 0 solid rgba(0, 0, 0, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);padding-bottom:5pt;padding-top:5pt;padding-left:5pt;padding-right:5pt;line-height: 1;background-color:transparent;}.cl-c1800b32{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b50{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b5a{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b64{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b6e{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b78{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0 solid rgba(0, 0, 0, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b79{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b82{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b8c{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800b96{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800ba0{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800baa{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bab{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bb4{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bbe{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bc8{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bd2{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bdc{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 0.5pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bdd{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800be6{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bf0{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800bfa{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c04{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c05{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 0.5pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c0e{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c18{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c22{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c23{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c2c{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c36{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c40{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c41{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c4a{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c54{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c5e{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c68{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 0 solid rgba(255, 255, 255, 0.00);border-top: 0 solid rgba(255, 255, 255, 0.00);border-left: 0 solid rgba(255, 255, 255, 0.00);border-right: 0 solid rgba(255, 255, 255, 0.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c69{width:64.1pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c72{width:52.7pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c7c{width:55.3pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c86{width:56.2pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c90{width:92.6pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}.cl-c1800c9a{width:71.7pt;background-color:transparent;vertical-align: middle;border-bottom: 2pt solid rgba(102, 102, 102, 1.00);border-top: 2pt solid rgba(102, 102, 102, 1.00);border-left: 0 solid rgba(0, 0, 0, 1.00);border-right: 0 solid rgba(0, 0, 0, 1.00);margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;}</style><table class='cl-c1876044'><thead><tr style="overflow-wrap:break-word;"><td class="cl-c1800c9a"><p class="cl-c17fc190"><span class="cl-c17faf98"></span></p></td><td class="cl-c1800c69"><p class="cl-c17fc1a4"><span class="cl-c17faf98">Estimate</span></p></td><td class="cl-c1800c90"><p class="cl-c17fc1a4"><span class="cl-c17faf98">Standard Error</span></p></td><td class="cl-c1800c7c"><p class="cl-c17fc1a4"><span class="cl-c17faf98">z value</span></p></td><td class="cl-c1800c86"><p class="cl-c17fc1a4"><span class="cl-c17faf98">Pr(&gt;|z|)</span></p></td><td class="cl-c1800c72"><p class="cl-c17fc190"><span class="cl-c17faf98">Signif.</span></p></td></tr></thead><tbody><tr style="overflow-wrap:break-word;"><td class="cl-c1800b6e"><p class="cl-c17fc190"><span class="cl-c17fafb6">(Intercept)</span></p></td><td class="cl-c1800b50"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">-7.476</span></p></td><td class="cl-c1800b32"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">3.570</span></p></td><td class="cl-c1800b5a"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">-2.094</span></p></td><td class="cl-c1800b78"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.0362</span></p></td><td class="cl-c1800b64"><p class="cl-c17fc190"><span class="cl-c17fafb6">*</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c1800baa"><p class="cl-c17fc190"><span class="cl-c17fafb6">learning</span></p></td><td class="cl-c1800ba0"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.164</span></p></td><td class="cl-c1800b96"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.053</span></p></td><td class="cl-c1800b79"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">3.079</span></p></td><td class="cl-c1800b82"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.0021</span></p></td><td class="cl-c1800b8c"><p class="cl-c17fc190"><span class="cl-c17fafb6">**</span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c1800bb4"><p class="cl-c17fc190"><span class="cl-c17fafb6">critical</span></p></td><td class="cl-c1800bab"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">-0.001</span></p></td><td class="cl-c1800bc8"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.044</span></p></td><td class="cl-c1800bdc"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">-0.013</span></p></td><td class="cl-c1800bd2"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.9896</span></p></td><td class="cl-c1800bbe"><p class="cl-c17fc190"><span class="cl-c17fafb6"></span></p></td></tr><tr style="overflow-wrap:break-word;"><td class="cl-c1800bfa"><p class="cl-c17fc190"><span class="cl-c17fafb6">advance</span></p></td><td class="cl-c1800bf0"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">-0.062</span></p></td><td class="cl-c1800c05"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.042</span></p></td><td class="cl-c1800bdd"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">-1.472</span></p></td><td class="cl-c1800c04"><p class="cl-c17fc1a4"><span class="cl-c17fafb6">0.1410</span></p></td><td class="cl-c1800be6"><p class="cl-c17fc190"><span class="cl-c17fafb6"></span></p></td></tr></tbody><tfoot><tr style="overflow-wrap:break-word;"><td colspan="6"class="cl-c1800c36"><p class="cl-c17fc1a4"><span class="cl-c17fafc0">Signif. codes: 0 &lt;= '***' &lt; 0.001 &lt; '**' &lt; 0.01 &lt; '*' &lt; 0.05 &lt; '.' &lt; 0.1 &lt; '' &lt; 1</span></p></td></tr><tr style="overflow-wrap:break-word;"><td colspan="6"class="cl-c1800c4a"><p class="cl-c17fc190"><span class="cl-c17fafb6"> </span></p></td></tr><tr style="overflow-wrap:break-word;"><td colspan="6"class="cl-c1800c4a"><p class="cl-c17fc190"><span class="cl-c17fafb6">(Dispersion parameter for binomial family taken to be 1)</span></p></td></tr><tr style="overflow-wrap:break-word;"><td colspan="6"class="cl-c1800c4a"><p class="cl-c17fc190"><span class="cl-c17fafb6">Null deviance: 38.19 on 29 degrees of freedom</span></p></td></tr><tr style="overflow-wrap:break-word;"><td colspan="6"class="cl-c1800c4a"><p class="cl-c17fc190"><span class="cl-c17fafb6">Residual deviance: 18.17 on 26 degrees of freedom</span></p></td></tr></tfoot></table></div></template>
<div class="flextable-shadow-host" id="200a9733-920e-401b-a311-831032710819"></div>
<script>
var dest = document.getElementById("200a9733-920e-401b-a311-831032710819");
var template = document.getElementById("19b7d540-a80d-4d0e-8aa0-ee421826b798");
var caption = template.content.querySelector("caption");
if(caption) {
caption.style.cssText = "display:block;text-align:center;";
var newcapt = document.createElement("p");
newcapt.appendChild(caption)
dest.parentNode.insertBefore(newcapt, dest.previousSibling);
}
var fantome = dest.attachShadow({mode: 'open'});
var templateContent = template.content;
fantome.appendChild(templateContent);
</script>
---
class: center, bg_hf
# Header and footers
<style type="text/css">
.bg_hf {
position: relative;
z-index: 1;
}
.bg_hf::before {
content: "";
background-image: url('static/assets/img/flextable_layout_header_footer.png');
background-size: 50%;
position: absolute;
top: 30%;
bottom: 0;
left: 50%;
z-index: -1;
right: 0;
background-repeat: no-repeat;
}
</style>
---