Chapter 15 Datasets used for illustrations

The following settings are used to minimise the necessary code to present the datasets when transformed as flextables.

use_df_printer()
set_flextable_defaults(
  padding.bottom = 3, 
  padding.top = 3,
  padding.left = 3,
  padding.right = 3,
  scroll = list(),
  table.layout = "autofit",
  theme_fun = theme_vanilla
)

15.1 Tennis players

This dataset was created by hand. It represents a ranking of tennis players. It includes in addition to some statistics the names of the images representing the flag of the player’s country of origin as well as a picture of the player.

tennis_players
Table 15.1: Tennis players

Rank

Player

Percentage

Games.Won

Total.Games

Matches

head

flag

integer

character

numeric

integer

integer

integer

character

character

1

Roger Federer

92.63

2 739

2 957

205

./static/img/players/federer_head.png

./static/img/flags/sui.png

2

Lleyton Hewitt

85.29

1 740

2 040

149

./static/img/players/hewitt_head.png

./static/img/flags/aus.png

3

Feliciano Lopez

89.86

1 684

1 874

122

./static/img/players/lopez_head.png

./static/img/flags/esp.png

4

Ivo Karlovic

94.87

1 645

1 734

113

./static/img/players/karlovic_head.png

./static/img/flags/cro.png

5

Andy Murray

88.89

1 528

1 719

121

./static/img/players/murray_head.png

./static/img/flags/gbr.png

6

Pete Sampras

92.66

1 478

1 595

105

./static/img/players/sampras_head.png

./static/img/flags/usa.png

7

Greg Rusedski

90.33

1 476

1 634

116

./static/img/players/rusedski_head.png

./static/img/flags/gbr.png

8

Tim Henman

83.77

1 461

1 744

110

./static/img/players/henman_head.png

./static/img/flags/gbr.png

9

Novak Djokovic

89.12

1 442

1 618

106

./static/img/players/djokovic_head.png

./static/img/flags/srb.png

10

Andy Roddick

92.76

1 410

1 520

103

./static/img/players/roddick_head.png

./static/img/flags/usa.png

n: 10

15.2 Diabetic data

This dataset was derived from survival::diabetic. It is an aggragation and a reshaping of the dataset.

diabetic
Table 15.2: diabetic

laser

eye

trt

risk-06

risk-08

risk-09

risk-10

risk-11

risk-12

factor

factor

factor

numeric

numeric

numeric

numeric

numeric

numeric

xenon

left

no treatment

40.17

46.20

44.60

21.97

24.73

22.09

xenon

left

laser

43.33

29.03

58.19

42.07

42.27

50.63

xenon

right

no treatment

21.05

29.03

47.60

18.93

29.97

34.20

xenon

right

laser

60.48

40.17

38.77

14.82

42.10

32.20

argon

left

no treatment

25.88

31.02

40.06

19.60

40.20

9.63

argon

left

laser

55.18

42.23

49.97

28.60

40.98

50.91

argon

right

no treatment

55.13

43.70

22.20

12.73

40.39

12.17

argon

right

laser

52.77

13.83

46.90

31.63

56.97

52.33

n: 8

15.3 Fishes

This dataset was provided as a fake example by a user, it contains informations about some fishes.

fishes
Table 15.3: fishes

latin_name

french_name

X00

X01

character

character

character

character

Acipenser Sturio

(L. 1758) Esturgeon européen

Alosa alosa

(L.1758) Alose vraie

+

+

Alosa fallax

(Lac. 1803) Alose feinte

+

+

Anguilla anguilla

(L. 1758) Anguille

+

+

Lampetra fluviatilis

(L. 1758) Lamproie de rivière

+

Liza ramada

(Risso 1826) Mulet porc

+

+

n: 6

15.4 people

This dataset was simulated with package charlatan.

people
Table 15.4: people

name

birthday

n_children

weight

height

n_peanuts

eye_color

character

Date

numeric

numeric

numeric

numeric

factor

Laetitia-Frédérique Techer

2019-09-03

4

72.87

167.13

633 372

dark

Audrey Navarro

2030-10-27

1

<na>

163.51

895 357

dark

Alexandrie Lecoq

2031-01-08

4

<na>

169.66

890 553

dark

Pénélope Coste

2040-07-04

4

<na>

172.40

939 592

green

Hugues Bertin

2013-05-16

0

78.23

168.98

771 953

dark

David Dubois

2026-10-29

3

59.32

177.89

823 299

green

Jean Joly

1996-05-10

1

76.99

164.71

767 889

green

Tristan Marié

2032-09-20

2

51.59

168.28

656 439

dark

Maurice Colas

2002-03-10

2

69.26

171.86

1 107 320

dark

Odette Jéan

2002-04-13

2

63.50

170.45

853 624

green

n: 10

15.5 Correlations

correlations
Table 15.5: correlations

rowname

mpg

cyl

disp

hp

drat

wt

qsec

vs

am

gear

carb

character

numeric

numeric

numeric

numeric

numeric

numeric

numeric

numeric

numeric

numeric

numeric

mpg

1.00

-0.85

-0.85

-0.78

0.68

-0.87

0.42

0.66

0.60

0.48

-0.55

cyl

-0.85

1.00

0.90

0.83

-0.70

0.78

-0.59

-0.81

-0.52

-0.49

0.53

disp

-0.85

0.90

1.00

0.79

-0.71

0.89

-0.43

-0.71

-0.59

-0.56

0.39

hp

-0.78

0.83

0.79

1.00

-0.45

0.66

-0.71

-0.72

-0.24

-0.13

0.75

drat

0.68

-0.70

-0.71

-0.45

1.00

-0.71

0.09

0.44

0.71

0.70

-0.09

wt

-0.87

0.78

0.89

0.66

-0.71

1.00

-0.17

-0.55

-0.69

-0.58

0.43

qsec

0.42

-0.59

-0.43

-0.71

0.09

-0.17

1.00

0.74

-0.23

-0.21

-0.66

vs

0.66

-0.81

-0.71

-0.72

0.44

-0.55

0.74

1.00

0.17

0.21

-0.57

am

0.60

-0.52

-0.59

-0.24

0.71

-0.69

-0.23

0.17

1.00

0.79

0.06

gear

0.48

-0.49

-0.56

-0.13

0.70

-0.58

-0.21

0.21

0.79

1.00

0.27

n: 11

15.6 Cancers

Some data provided by a user, they are available here: http://users.stat.ufl.edu/~aa/cat/data/Cancer.dat

cancers
Table 15.6: cancers

time

1_1

1_2

1_3

2_1

2_2

2_3

3_1

3_2

3_3

integer

integer

integer

integer

integer

integer

integer

integer

integer

integer

1

9

12

42

5

4

28

1

1

19

2

2

7

26

2

3

19

1

1

11

3

9

5

12

3

5

10

1

3

7

4

10

10

10

2

4

5

1

1

6

5

1

4

5

2

2

0

0

0

3

6

3

3

4

2

1

3

1

0

3

7

1

4

1

2

4

2

0

2

3

n: 7

It also comes with a table of headers:

cancers_header
Table 15.7: cancers header

col_keys

line2

line3

character

character

character

time

Follow-up

Follow-up

1_1

I

1

2_1

I

2

3_1

I

3

1_2

II

1

2_2

II

2

3_2

II

3

1_3

III

1

2_3

III

2

3_3

III

3

n: 10