LAB 3.1: Make a Plot

PACKAGES AND DATASET

FILTER DATASET

LOOK AT DATASET

           Name Age Nationality Overall Potential        Club Value Wage
7      L. Modri  32     Croatia      91        91 Real Madrid    67  420
9  Sergio Ramos  32       Spain      91        91 Real Madrid    51  380
12     T. Kroos  28     Germany      90        90 Real Madrid  76.5  355
20  T. Courtois  26     Belgium      89        90 Real Madrid  53.5  240
28     Casemiro  26      Brazil      88        90 Real Madrid  59.5  285
31         Isco  26       Spain      88        91 Real Madrid  73.5  315
36      Marcelo  30      Brazil      88        88 Real Madrid    43  285
37      G. Bale  28       Wales      88        88 Real Madrid    60  355
47     K. Navas  31  Costa Rica      87        87 Real Madrid  30.5  195
63    R. Varane  25      France      86        91 Real Madrid    50  210
   Special Preferred.Foot International.Reputation Weak.Foot Skill.Moves
7     2280          Right                        4         4           4
9     2201          Right                        4         3           3
12    2190          Right                        4         5           3
20    1311           Left                        4         2           1
28    2170          Right                        3         3           2
31    2137          Right                        3         3           4
36    2279           Left                        4         4           5
37    2279           Left                        4         3           4
47    1345          Right                        3         3           1
63    1895          Right                        3         3           2
        Work.Rate Position Jersey.Number Contract.Valid.Until Height   Weight
7      High/ High      RCM            10                 2020 172.72 66.22449
9    High/ Medium      RCB            15                 2020 182.88 82.10022
12 Medium/ Medium      LCM             8                 2022 182.88 76.20352
20 Medium/ Medium       GK             1                 2024 198.12 96.16158
28   Medium/ High      CDM            14                 2021 185.42 83.91459
31   High/ Medium       LW            22                 2022 175.26 78.92507
36      High/ Low       LB            12                 2022 175.26 79.83226
37   High/ Medium       ST            11                 2022 185.42 82.10022
47 Medium/ Medium       GK             1                 2020 185.42 79.83226
63   Medium/ High      RCB             4                 2022 190.50 81.19303
     LS   ST   RS   LW   LF   CF   RF   RW  LAM  CAM  RAM   LM  LCM   CM  RCM
7  77+3 77+3 77+3 85+3 84+3 84+3 84+3 85+3 87+3 87+3 87+3 86+3 88+3 88+3 88+3
9  73+3 73+3 73+3 70+3 71+3 71+3 71+3 70+3 71+3 71+3 71+3 72+3 75+3 75+3 75+3
12 78+3 78+3 78+3 81+3 82+3 82+3 82+3 81+3 84+3 84+3 84+3 82+3 86+3 86+3 86+3
20                                                                           
28 72+3 72+3 72+3 69+3 73+3 73+3 73+3 69+3 74+3 74+3 74+3 71+3 80+3 80+3 80+3
31 76+3 76+3 76+3 84+3 83+3 83+3 83+3 84+3 86+3 86+3 86+3 83+3 83+3 83+3 83+3
36 80+3 80+3 80+3 84+3 83+3 83+3 83+3 84+3 84+3 84+3 84+3 85+3 84+3 84+3 84+3
37 86+3 86+3 86+3 86+3 86+3 86+3 86+3 86+3 85+3 85+3 85+3 85+3 80+3 80+3 80+3
47                                                                           
63 62+3 62+3 62+3 61+3 63+3 63+3 63+3 61+3 64+3 64+3 64+3 64+3 69+3 69+3 69+3
     RM  LWB  LDM  CDM  RDM  RWB   LB  LCB   CB  RCB   RB Crossing Finishing
7  86+3 82+3 81+3 81+3 81+3 82+3 79+3 71+3 71+3 71+3 79+3       86        72
9  72+3 81+3 84+3 84+3 84+3 81+3 84+3 87+3 87+3 87+3 84+3       66        60
12 82+3 79+3 82+3 82+3 82+3 79+3 77+3 72+3 72+3 72+3 77+3       88        76
20                                                              14        14
28 71+3 78+3 85+3 85+3 85+3 78+3 79+3 85+3 85+3 85+3 79+3       52        59
31 83+3 72+3 73+3 73+3 73+3 72+3 68+3 63+3 63+3 63+3 68+3       75        79
36 85+3 85+3 83+3 83+3 83+3 85+3 84+3 81+3 81+3 81+3 84+3       90        70
37 85+3 73+3 70+3 70+3 70+3 73+3 71+3 67+3 67+3 67+3 71+3       87        86
47                                                              11        15
63 64+3 75+3 79+3 79+3 79+3 75+3 78+3 83+3 83+3 83+3 78+3       36        40
   HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy LongPassing
7               55           93      76        90    85         78          88
9               91           78      66        63    74         72          77
12              54           92      82        81    86         84          93
20              13           33      12        13    19         20          35
28              76           85      53        69    59         74          82
31              55           89      65        94    88         76          83
36              75           84      54        90    85         67          76
37              84           85      85        87    90         87          80
47              11           30      11        16    11         15          37
63              83           75      42        57    46         54          76
   BallControl Acceleration SprintSpeed Agility Reactions Balance ShotPower
7           93           80          72      93        90      94        79
9           84           76          75      78        85      66        79
12          90           64          62      70        89      71        87
20          23           46          52      61        84      45        36
28          78           59          65      62        84      66        86
31          95           75          69      87        77      90        69
36          92           83          82      86        88      86        83
37          85           94          95      82        85      65        92
47          19           54          53      60        84      61        21
63          77           83          85      63        83      40        52
   Jumping Stamina Strength LongShots Aggression Interceptions Positioning
7       68      89       58        82         62            83          79
9       93      84       83        59         88            90          60
12      30      75       73        92         60            82          79
20      68      38       70        17         23            15          13
28      88      87       89        79         87            87          69
31      64      70       59        87         58            64          78
36      76      91       78        70         84            85          85
37      87      75       80        91         65            59          85
47      74      39       75        13         32            20          16
63      79      73       84        53         77            82          44
   Vision Penalties Composure Marking StandingTackle SlidingTackle GKDiving
7      92        82        84      60             76            73       13
9      63        75        82      87             92            91       11
12     86        73        85      72             79            69       10
20     44        27        66      20             18            16       85
28     77        66        84      88             90            87       13
31     89        76        86      60             64            51       10
36     82        59        86      71             85            86       12
37     79        76        86      54             55            52       15
47     68        25        67      28             14            14       90
63     56        43        82      87             88            87       11
   GKHandling GKKicking GKPositioning GKReflexes Release.Clause
7           9         7            14          9          137.4
9           8         9             7         11          104.6
12         11        13             7         10          156.8
20         91        72            86         88          113.7
28         14        16            12         12          126.4
31          8        12            15          6          156.2
36          5         5             5          9           88.2
37         15        11             5          6            123
47         81        75            82         90           62.5
63         11         9             5         14          106.3
   mydata.Penalties mydata.Agility mydata.Wage mydata.Preferred.Foot
7                82             93         420                 Right
9                75             78         380                 Right
12               73             70         355                 Right
20               27             61         240                  Left
28               66             62         285                 Right
31               76             87         315                 Right
36               59             86         285                  Left
37               76             82         355                  Left
47               25             60         195                 Right
63               43             63         210                 Right
                 Name Age Nationality Overall Potential        Club Value Wage
6725          Reguiln  21       Spain      68        80 Real Madrid   1.4   28
8733      Javi Snchez  21       Spain      67        79 Real Madrid   1.2   24
9142   Cristo Gonzlez  20       Spain      66        78 Real Madrid   1.2   26
10179 F. Feuillassier  20   Argentina      65        80 Real Madrid   1.2   23
10270         Fidalgo  21       Spain      65        75 Real Madrid   875   20
11164     Sergio Lpez  19       Spain      64        80 Real Madrid   875    9
11328      Fran Garca  18       Spain      64        79 Real Madrid   825    9
11878   Manu Hernando  19       Spain      64        76 Real Madrid   700    9
12505       Dani Gmez  19       Spain      63        77 Real Madrid   800   12
13688       L. Zidane  20      France      62        71 Real Madrid   350    9
      Special Preferred.Foot International.Reputation Weak.Foot Skill.Moves
6725     1619           Left                        1         3           3
8733     1444          Right                        1         3           2
9142     1701          Right                        1         2           3
10179    1574          Right                        1         4           3
10270    1673          Right                        1         3           3
11164    1715          Right                        1         3           3
11328    1644           Left                        1         3           2
11878    1568          Right                        1         3           2
12505    1448          Right                        1         3           2
13688     944          Right                        1         3           1
           Work.Rate Position Jersey.Number Contract.Valid.Until Height
6725    High/ Medium       LB            23                 2020 177.80
8733  Medium/ Medium       CB            31                 2019 187.96
9142  Medium/ Medium       ST            27                 2019 177.80
10179 Medium/ Medium       LW            34                 2019 172.72
10270   High/ Medium       CM            36                 2019 175.26
11164   High/ Medium       RB            32                 2019 177.80
11328   High/ Medium       LB            37                 2019 170.18
11878 Medium/ Medium       CB            33                 2021 180.34
12505 Medium/ Medium       ST            38                 2022 177.80
13688 Medium/ Medium       GK            30                 2019 182.88
        Weight   LS   ST   RS   LW   LF   CF   RF   RW  LAM  CAM  RAM   LM  LCM
6725  68.03886 52+2 52+2 52+2 58+2 56+2 56+2 56+2 58+2 57+2 57+2 57+2 61+2 58+2
8733  77.11070 45+2 45+2 45+2 44+2 44+2 44+2 44+2 44+2 45+2 45+2 45+2 46+2 50+2
9142  73.93556 65+2 65+2 65+2 66+2 66+2 66+2 66+2 66+2 66+2 66+2 66+2 65+2 61+2
10179 68.94604 63+2 63+2 63+2 64+2 64+2 64+2 64+2 64+2 62+2 62+2 62+2 62+2 55+2
10270 68.03886 57+2 57+2 57+2 63+2 62+2 62+2 62+2 63+2 64+2 64+2 64+2 64+2 64+2
11164 66.22449 58+2 58+2 58+2 61+2 59+2 59+2 59+2 61+2 59+2 59+2 59+2 61+2 58+2
11328 63.04934 53+2 53+2 53+2 60+2 57+2 57+2 57+2 60+2 57+2 57+2 57+2 61+2 57+2
11878 77.11070 51+2 51+2 51+2 52+2 52+2 52+2 52+2 52+2 52+2 52+2 52+2 54+2 54+2
12505 69.85322 61+2 61+2 61+2 57+2 59+2 59+2 59+2 57+2 57+2 57+2 57+2 55+2 48+2
13688 77.11070                                                                 
        CM  RCM   RM  LWB  LDM  CDM  RDM  RWB   LB  LCB   CB  RCB   RB Crossing
6725  58+2 58+2 61+2 67+2 62+2 62+2 62+2 67+2 67+2 63+2 63+2 63+2 67+2       66
8733  50+2 50+2 46+2 59+2 61+2 61+2 61+2 59+2 61+2 66+2 66+2 66+2 61+2       32
9142  61+2 61+2 65+2 51+2 51+2 51+2 51+2 51+2 49+2 45+2 45+2 45+2 49+2       54
10179 55+2 55+2 62+2 48+2 44+2 44+2 44+2 48+2 44+2 38+2 38+2 38+2 44+2       64
10270 64+2 64+2 64+2 58+2 59+2 59+2 59+2 58+2 56+2 52+2 52+2 52+2 56+2       61
11164 58+2 58+2 61+2 63+2 59+2 59+2 59+2 63+2 63+2 59+2 59+2 59+2 63+2       63
11328 57+2 57+2 61+2 63+2 58+2 58+2 58+2 63+2 62+2 57+2 57+2 57+2 62+2       65
11878 54+2 54+2 54+2 60+2 60+2 60+2 60+2 60+2 61+2 63+2 63+2 63+2 61+2       44
12505 48+2 48+2 55+2 39+2 38+2 38+2 38+2 39+2 38+2 36+2 36+2 36+2 38+2       32
13688                                                                        12
      Finishing HeadingAccuracy ShortPassing Volleys Dribbling Curve FKAccuracy
6725         22              59           62      18        63    50         39
8733         28              66           63      18        34    27         34
9142         70              58           64      60        69    64         50
10179        72              49           62      55        70    44         45
10270        49              44           69      46        68    62         53
11164        52              56           61      48        64    57         41
11328        42              44           57      39        62    55         36
11878        32              68           62      29        56    44         39
12505        67              58           54      54        60    41         45
13688         8              12           22       6        10    14         11
      LongPassing BallControl Acceleration SprintSpeed Agility Reactions
6725           44          67           74          72      52        66
8733           38          61           55          64      41        63
9142           60          68           73          70      70        60
10179          45          65           68          68      67        53
10270          65          70           65          63      68        62
11164          56          63           78          79      69        63
11328          49          65           79          79      68        62
11878          53          64           61          63      61        59
12505          35          66           66          65      70        56
13688          15          14           33          32      36        54
      Balance ShotPower Jumping Stamina Strength LongShots Aggression
6725       71        54      60      72       45        33         58
8733       51        38      72      68       68        32         70
9142       71        65      65      63       49        63         52
10179      78        72      47      62       61        71         45
10270      77        54      51      64       49        48         62
11164      72        63      61      61       51        59         62
11328      89        47      60      66       44        45         63
11878      64        47      59      66       62        45         58
12505      65        59      62      51       70        52         28
13688      49        15      63      38       50         5         16
      Interceptions Positioning Vision Penalties Composure Marking
6725             67          56     54        42        64      66
8733             67          25     35        38        55      64
9142             29          68     67        54        61      45
10179            22          58     56        50        54      35
10270            52          59     70        49        68      46
11164            60          50     46        43        62      59
11328            62          49     54        39        60      60
11878            55          43     37        42        47      70
12505            12          61     42        57        44      41
13688            14           5     45        19        36      13
      StandingTackle SlidingTackle GKDiving GKHandling GKKicking GKPositioning
6725              68            68       11         14         9             5
8733              67            65       11         15        13             8
9142              39            26       11          9        13             9
10179             23            20        7         13         9            13
10270             51            47       10          9        10            11
11164             61            62       12         12        11             7
11328             58            59        9          6        12             9
11878             65            67       11         12        13            12
12505             12            15        7         10        13             8
13688             11            13       65         60        61            62
      GKReflexes Release.Clause mydata.Penalties mydata.Agility mydata.Wage
6725          12            3.2               42             52          28
8733          13            2.7               38             41          24
9142          13            2.6               54             70          26
10179          5            3.2               50             67          23
10270          9              2               49             68          20
11164         13            2.3               43             69           9
11328         11            2.2               39             68           9
11878          5            1.6               42             61           9
12505         14            2.1               57             70          12
13688         61            788               19             36           9
      mydata.Preferred.Foot
6725                   Left
8733                  Right
9142                  Right
10179                 Right
10270                 Right
11164                 Right
11328                  Left
11878                 Right
12505                 Right
13688                 Right
'data.frame':   33 obs. of  80 variables:
 $ Name                    : chr  "L. Modri" "Sergio Ramos" "T. Kroos" "T. Courtois" ...
 $ Age                     : int  32 32 28 26 26 26 30 28 31 25 ...
 $ Nationality             : Factor w/ 164 levels "Afghanistan",..: 36 141 60 14 21 141 21 162 35 55 ...
 $ Overall                 : int  91 91 90 89 88 88 88 88 87 86 ...
 $ Potential               : int  91 91 90 90 90 91 88 88 87 91 ...
 $ Club                    : Factor w/ 652 levels ""," SSV Jahn Regensburg",..: 475 475 475 475 475 475 475 475 475 475 ...
 $ Value                   : chr  "67" "51" "76.5" "53.5" ...
 $ Wage                    : chr  "420" "380" "355" "240" ...
 $ Special                 : int  2280 2201 2190 1311 2170 2137 2279 2279 1345 1895 ...
 $ Preferred.Foot          : Factor w/ 3 levels "","Left","Right": 3 3 3 2 3 3 2 2 3 3 ...
 $ International.Reputation: int  4 4 4 4 3 3 4 4 3 3 ...
 $ Weak.Foot               : int  4 3 5 2 3 3 4 3 3 3 ...
 $ Skill.Moves             : int  4 3 3 1 2 4 5 4 1 2 ...
 $ Work.Rate               : Factor w/ 10 levels "","High/ High",..: 2 4 10 10 8 4 3 4 10 8 ...
 $ Position                : Factor w/ 28 levels "","CAM","CB",..: 21 20 11 7 4 16 9 28 7 20 ...
 $ Jersey.Number           : int  10 15 8 1 14 22 12 11 1 4 ...
 $ Contract.Valid.Until    : Factor w/ 37 levels "","2018","2019",..: 4 4 6 8 5 6 6 6 4 6 ...
 $ Height                  : num  173 183 183 198 185 ...
 $ Weight                  : num  66.2 82.1 76.2 96.2 83.9 ...
 $ LS                      : Factor w/ 94 levels "","31+2","32+2",..: 75 67 77 1 65 73 81 90 1 45 ...
 $ ST                      : Factor w/ 94 levels "","31+2","32+2",..: 75 67 77 1 65 73 81 90 1 45 ...
 $ RS                      : Factor w/ 94 levels "","31+2","32+2",..: 75 67 77 1 65 73 81 90 1 45 ...
 $ LW                      : Factor w/ 106 levels "","25+2","27+2",..: 101 71 94 1 69 100 100 102 1 53 ...
 $ LF                      : Factor w/ 103 levels "","27+2","29+2",..: 95 68 91 1 72 93 93 97 1 52 ...
 $ CF                      : Factor w/ 103 levels "","27+2","29+2",..: 95 68 91 1 72 93 93 97 1 52 ...
 $ RF                      : Factor w/ 103 levels "","27+2","29+2",..: 95 68 91 1 72 93 93 97 1 52 ...
 $ RW                      : Factor w/ 106 levels "","25+2","27+2",..: 101 71 94 1 69 100 100 102 1 53 ...
 $ LAM                     : Factor w/ 102 levels "","27+2","28+2",..: 99 69 95 1 75 98 95 96 1 55 ...
 $ CAM                     : Factor w/ 102 levels "","27+2","28+2",..: 99 69 95 1 75 98 95 96 1 55 ...
 $ RAM                     : Factor w/ 102 levels "","27+2","28+2",..: 99 69 95 1 75 98 95 96 1 55 ...
 $ LM                      : Factor w/ 101 levels "","27+2","28+2",..: 98 70 91 1 68 93 97 97 1 54 ...
 $ LCM                     : Factor w/ 93 levels "","30+2","31+2",..: 93 70 91 1 81 87 89 81 1 57 ...
 $ CM                      : Factor w/ 93 levels "","30+2","31+2",..: 93 70 91 1 81 87 89 81 1 57 ...
 $ RCM                     : Factor w/ 93 levels "","30+2","31+2",..: 93 70 91 1 81 87 89 81 1 57 ...
 $ RM                      : Factor w/ 101 levels "","27+2","28+2",..: 98 70 91 1 68 93 97 97 1 54 ...
 $ LWB                     : Factor w/ 96 levels "","30+2","31+2",..: 93 91 87 1 85 73 96 75 1 79 ...
 $ LDM                     : Factor w/ 100 levels "","28+2","29+2",..: 92 97 94 1 98 76 96 70 1 88 ...
 $ CDM                     : Factor w/ 100 levels "","28+2","29+2",..: 92 97 94 1 98 76 96 70 1 88 ...
 $ RDM                     : Factor w/ 100 levels "","28+2","29+2",..: 92 97 94 1 98 76 96 70 1 88 ...
 $ RWB                     : Factor w/ 96 levels "","30+2","31+2",..: 93 91 87 1 85 73 96 75 1 79 ...
 $ LB                      : Factor w/ 99 levels "","29+2","30+2",..: 91 99 87 1 91 69 99 75 1 89 ...
 $ LCB                     : Factor w/ 109 levels "","25+2","27+2",..: 81 109 83 1 107 64 101 73 1 105 ...
 $ CB                      : Factor w/ 109 levels "","25+2","27+2",..: 81 109 83 1 107 64 101 73 1 105 ...
 $ RCB                     : Factor w/ 109 levels "","25+2","27+2",..: 81 109 83 1 107 64 101 73 1 105 ...
 $ RB                      : Factor w/ 99 levels "","29+2","30+2",..: 91 99 87 1 91 69 99 75 1 89 ...
 $ Crossing                : int  86 66 88 14 52 75 90 87 11 36 ...
 $ Finishing               : int  72 60 76 14 59 79 70 86 15 40 ...
 $ HeadingAccuracy         : int  55 91 54 13 76 55 75 84 11 83 ...
 $ ShortPassing            : int  93 78 92 33 85 89 84 85 30 75 ...
 $ Volleys                 : int  76 66 82 12 53 65 54 85 11 42 ...
 $ Dribbling               : int  90 63 81 13 69 94 90 87 16 57 ...
 $ Curve                   : int  85 74 86 19 59 88 85 90 11 46 ...
 $ FKAccuracy              : int  78 72 84 20 74 76 67 87 15 54 ...
 $ LongPassing             : int  88 77 93 35 82 83 76 80 37 76 ...
 $ BallControl             : int  93 84 90 23 78 95 92 85 19 77 ...
 $ Acceleration            : int  80 76 64 46 59 75 83 94 54 83 ...
 $ SprintSpeed             : int  72 75 62 52 65 69 82 95 53 85 ...
 $ Agility                 : int  93 78 70 61 62 87 86 82 60 63 ...
 $ Reactions               : int  90 85 89 84 84 77 88 85 84 83 ...
 $ Balance                 : int  94 66 71 45 66 90 86 65 61 40 ...
 $ ShotPower               : int  79 79 87 36 86 69 83 92 21 52 ...
 $ Jumping                 : int  68 93 30 68 88 64 76 87 74 79 ...
 $ Stamina                 : int  89 84 75 38 87 70 91 75 39 73 ...
 $ Strength                : int  58 83 73 70 89 59 78 80 75 84 ...
 $ LongShots               : int  82 59 92 17 79 87 70 91 13 53 ...
 $ Aggression              : int  62 88 60 23 87 58 84 65 32 77 ...
 $ Interceptions           : int  83 90 82 15 87 64 85 59 20 82 ...
 $ Positioning             : int  79 60 79 13 69 78 85 85 16 44 ...
 $ Vision                  : int  92 63 86 44 77 89 82 79 68 56 ...
 $ Penalties               : int  82 75 73 27 66 76 59 76 25 43 ...
 $ Composure               : int  84 82 85 66 84 86 86 86 67 82 ...
 $ Marking                 : int  60 87 72 20 88 60 71 54 28 87 ...
 $ StandingTackle          : int  76 92 79 18 90 64 85 55 14 88 ...
 $ SlidingTackle           : int  73 91 69 16 87 51 86 52 14 87 ...
 $ GKDiving                : int  13 11 10 85 13 10 12 15 90 11 ...
 $ GKHandling              : int  9 8 11 91 14 8 5 15 81 11 ...
 $ GKKicking               : int  7 9 13 72 16 12 5 11 75 9 ...
 $ GKPositioning           : int  14 7 7 86 12 15 5 5 82 5 ...
 $ GKReflexes              : int  9 11 10 88 12 6 9 6 90 14 ...
 $ Release.Clause          : chr  "137.4" "104.6" "156.8" "113.7" ...

       Left Right 
    0     6    27 

SUMMARY STATISTICS

   Penalties        Agility     
 Min.   :19.00   Min.   :36.00  
 1st Qu.:42.00   1st Qu.:61.00  
 Median :53.00   Median :69.00  
 Mean   :52.88   Mean   :68.76  
 3rd Qu.:65.00   3rd Qu.:79.00  
 Max.   :82.00   Max.   :93.00  

CHART 1

CHART 2

FINAL CHART

INTERPRETATIONS

Among these three different charts, I believe that the one that is best understood and easiest to interpret is the third chart. It shows a scatter plot among with smooth curve that illustrate the relationship between Penalties and Agility among Real Madrid players, with points colored based on their Preferred Foot. The plot suggests a general positive trend, indicating that players with higher Penalties tend to have higher Agility. However, the intriguing insight comes from the distinction in the trend based on Preferred Foot. The relationship between penalties and agility for Real Madrid players categorized by preferred foot, it appears that right-footed players generally have higher agility scores across most penalty scores. The smoothing line for right-footed players shows a slight positive correlation between penalties and agility, indicating that right-footed players with higher penalty taking abilities also tend to have higher agility. In contrast, the smoothing line for left-footed players shows no clear correlation. This supports the subtitle that right-footed Real Madrid players demonstrate higher agility overall.

END