<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Harsh Krishna on Medium]]></title>
        <description><![CDATA[Stories by Harsh Krishna on Medium]]></description>
        <link>https://medium.com/@harshkrishna17?source=rss-2dbcc7d56e9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Harsh Krishna on Medium</title>
            <link>https://medium.com/@harshkrishna17?source=rss-2dbcc7d56e9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:40:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshkrishna17/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Some Useful R Tricks]]></title>
            <link>https://harshkrishna17.medium.com/some-useful-r-tricks-42c1dc394756?source=rss-2dbcc7d56e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/42c1dc394756</guid>
            <category><![CDATA[football]]></category>
            <category><![CDATA[rstats]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Harsh Krishna]]></dc:creator>
            <pubDate>Mon, 22 Nov 2021 11:04:12 GMT</pubDate>
            <atom:updated>2021-11-22T11:05:47.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*T1r9hTnSDYC8il1rUC-edQ.png" /></figure><h4>Basic data manipulation techniques using R</h4><p>R is one of the most popular programming languages for statistical analysis. It is especially useful for manipulation of datasets and has excellent libraries for the same, along with a large range of graphing libraries that allow for data visualizations to be made with high customizability.</p><p>In this tutorial, I’ll go through some basic techniques which I hope can be greatly useful for beginners with the language. These methods will help you to reshape datasets to the form you want, and we shall also go through some basic visualizations that you can make with R package <a href="https://github.com/abhiamishra/ggshakeR">ggshakeR</a>, made by <a href="https://twitter.com/MishraAbhiA">Abhi A. Mishra</a>.</p><p>All the code will be within the <a href="https://www.rstudio.com/products/rstudio/download/">RStudio</a> IDE and it is recommended that you download it here after downloading <a href="https://cran.r-project.org/bin/windows/base/">Base R</a>.</p><h4>Dataset</h4><p>Let’s first load in our dataset. We shall be using data from Understat and the package which will help us in extracting the data will be <a href="https://jaseziv.github.io/worldfootballR/">worldfootballR</a> by <a href="https://twitter.com/jaseziv">Jason Zivkovic</a>. Let’s install and load the package with these lines.</p><pre>install.packages(&quot;devtools&quot;)<br>devtools::<a href="https://devtools.r-lib.org//reference/remote-reexports.html">install_github</a>(&quot;JaseZiv/worldfootballR&quot;)<br>library(worldfootballR) </pre><p>Now, to load in the dataset of all Premier League shots from the 2021/22 season, we write</p><pre>data &lt;- understat_league_season_shots(league = &quot;EPL&quot;, season_start_year = 2021)</pre><h4>Tidyverse</h4><p>The tidyverse is a collection of packages that make our job of data manipulation and plotting easier. The two packages within the tidyverse which we shall use extensively are dplyr and tidyr.</p><pre>install.packages(&quot;tidyverse&quot;)<br>library(tidyverse)</pre><p>This concludes the packages part, for now. Let’s move onto working with the data.</p><h4>Filtering</h4><p>Let’s first learn to filter a dataset by a specific column value.</p><pre>data1 &lt;- data %&gt;%<br>  filter(situation == &quot;OpenPlay&quot;)</pre><p>This piece of code will filter the data for only open play shots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sAo-Sotyu5DLiq3qG_WXQ.png" /></figure><p>Keep in mind the I am calling the filtered data to a new data object so as to not disturb our original dataset. The <em>“%&gt;%”</em> is known as a pipe operator, which is what tells R to apply the certain function on the specific dataset that is called.</p><p>Now, what if you wanted to filter for two or more variables at the same time?</p><pre>data2 &lt;- data %&gt;%<br>  filter(situation == &quot;OpenPlay&quot; | situation == &quot;FromCorner&quot;)</pre><p>What about filtering with a not clause? If you wanted only non-penalty goals, you’d write</p><pre>data3 &lt;- data %&gt;%<br>  filter(!situation == &quot;Penalty&quot;)</pre><p>Note that the <em>“==” </em>operator is only for variables that are characters. You can also filter for numeric variables within the dataset by using some different operators such as</p><pre>data$minute &lt;- as.numeric(data$minute)</pre><pre>data4 &lt;- data %&gt;%<br>  filter(minute &gt;= 45)</pre><pre>data5 &lt;- data %&gt;%<br>  filter(minute &lt;= 45)</pre><pre>data6 &lt;- data %&gt;%<br>  filter(minute &gt; 20)</pre><p>If you noticed, I first made sure that the class of the minute column was a numeric so that the filtering worked correctly. There are many other functions like it :- <em>as.vector(), as.Date, as.data.frame()</em> etc.</p><p>You can check the class of a column or vector by running</p><pre>x &lt;- 1 ## numeric<br>class(x)</pre><p>The great thing about dplyr (tidyverse) is that you can add as many pipe operators <em>(%&gt;%)</em> to continue filtering (also using different dplyr functions : soon to come) without breaks in the code. An example is the following where all second half open-play goals are filtered out from the dataset.</p><pre>data7 &lt;- data %&gt;%<br>  filter(minute &gt;= 45) %&gt;%<br>  filter(situation == &quot;OpenPlay&quot;) %&gt;%<br>  filter(result == &quot;Goal&quot;)</pre><h4>Some stuff on Columns</h4><p>The <em>mutate()</em> function within dplyr allows you to create new columns which are resulted of calculations on already existing columns.</p><pre>data8 &lt;- data %&gt;%<br>  mutate(xGmean = mean(xG)) %&gt;%<br>  mutate(meandiff = xGmean - xG)</pre><p>This calculates the mean of the xG values and subtracts the singular values from the mean. The new columns would appear as such</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3jadF6gs6SP6YqpcK8zuw.png" /></figure><p>A new column can be created without any calculations as well</p><pre>data9 &lt;- data %&gt;%<br>  mutate(newcol = 90) %&gt;%<br>  mutate(newcol2 = &quot;Hi&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUeEQ5aPF_yfF_lxkRaeqA.png" /></figure><p>You can even rename columns using the <em>rename()</em> function, such as</p><pre>data10 &lt;- data %&gt;%<br>  rename(xGoals = xG)</pre><p>The new column name is to be used first.</p><p>We can also sort the values of a column in ascending or descending order.</p><pre># Ascending<br>data11 &lt;- data[order(as.numeric(data$xG),decreasing = FALSE),]<br># Descending<br>data12 &lt;- data[order(as.numeric(data$xG),decreasing = TRUE),]</pre><h4>Data Cleaning</h4><p>You might have noticed that this data frame does not have any missing values. This would not be the case with every dataset. Therefore, cleaning a dataset by either removing or replacing <em>NA </em>values is a very useful skill.</p><p>Let us first create some dummy <em>NA</em> values.</p><pre>df &lt;- data ## to keep original dataset intact<br>df$minute[df$minute == 10] &lt;- NA</pre><p>This replaces all the rows with 10 in the minutes column with<em> NA’</em>s.</p><p>Next, Let’s learn to replace those values with 0’s as well removing rows that have missing values from the dataset completely.</p><pre>## Replace with 0&#39;s<br>df[is.na(df)] &lt;- 0</pre><p>or</p><pre>## Removing rows with NA&#39;s<br>df &lt;- df %&gt;%<br>  na.omit()</pre><h4>Grouping</h4><p>Another extremely useful function is <em>group_by()</em> which allows you to group column variables as well as the <em>summarise()</em> function that allows to operate a different function of a column based on the grouping.</p><pre>df1 &lt;- data %&gt;%<br>  group_by(player) %&gt;%<br>  summarise(no = n(), xGsum = sum(xG))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPFZceFrz4NhG5mKkbL4Ug.png" /></figure><p>This creates a new data frame of players, their respective shots taken, and the sum of the xG of all their shots.</p><h4>Some concluding basic stuff</h4><p>Some of the other stuff you can do which will be extremely useful are :-</p><ol><li>Selecting specific rows and columns</li></ol><pre># dataframe &lt;- dataframe[rows, columns]</pre><pre>## This selects the first 3 rows and all the columns<br>dataframe &lt;- dataframe[c(1:3),] </pre><p>2. Binding together two or more datasets</p><pre># Binding together by rows<br>df &lt;- rbind(data1, data2) ## number of rows will increase</pre><pre># Binding together by columns <br>df &lt;- cbind(data1, data2) ## number of columns will increase</pre><p>A very important thing to make sure of is that while using <em>rbind()</em>, the number of columns of the datasets used within the function have to be the same. Similarly, while using <em>cbind()</em>, the number of rows have to be same.</p><p>You can check the number of rows and column of the dataset in the environment or you can run</p><pre>nrow(data) ## row<br>ncol(data) ## column </pre><p>3. Saving dataset as a csv file</p><pre>write.csv(df, &quot;df.csv&quot;, row.names = FALSE)</pre><h4>Plotting</h4><p>Now that we have learn so many different methods of working with the data, lets make good use of it by plotting it in a graph. For this purpose we shall install and load in R analysis package ggshakeR (as mentioned before in the tutorial).</p><pre>devtools::install_github(&quot;abhiamishra/ggshakeR&quot;, subdir=&quot;ggshakeR&quot;)<br>library(ggshakeR)</pre><p>ggshakeR has 6 different plotting functions that allow you to make graphs with extreme ease and allow for considerable customization as well. For the purpose of this tutorial, we shall only be using two of those functions, <em>plot_shot</em> (Shot maps) and <em>plot_trendline</em> (xG vs xGA Trendlines).</p><p>Lets filter shots for their situation and result and plot it using <em>plot_shot</em>.</p><pre>df &lt;- data %&gt;%<br>  filter(!situation == &quot;Penalty&quot;) %&gt;%<br>  filter(player == &quot;Mohamed Salah&quot;)</pre><pre>plot_shot(df)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nB2BG6pa5sJCJeVvfMpdNw.png" /></figure><p>And here we are, Mo Salah’s non penalty shot map for the 2021/22 PL season. Feel free to go through the ggshakeR docs to learn more about how you can create different types of shot maps using the function.</p><p>Now let’s go onto out final part for the day, plotting a trendline using the <em>plot_trendline</em> function. While the function works directly on FBref (StatsBomb) data, we can manipulate the dataset we have right now to mimic a dataframe that requires the minimum number of columns for it to work.</p><p>The current dataset in out hands (3127 rows &amp; 21 columns as of 22/11/2021) has to be converted to into something that looks like the one below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*tJydcSqCdxGHzzzRIElOmQ.png" /></figure><p>This is achievable using all the information that has been shared in this guide so far. If you’re feeling confident, give it a go! (consider it practice).</p><p>The solution is in the following box.</p><pre>df1 &lt;- data %&gt;%<br>  filter(h_a == &quot;h&quot;) %&gt;%<br>  filter(home_team == &quot;Manchester United&quot;) %&gt;%<br>  group_by(date) %&gt;%<br>  summarise(sum(xG))<br>df2 &lt;- data %&gt;%<br>  filter(h_a == &quot;a&quot;) %&gt;%<br>  filter(away_team == &quot;Manchester United&quot;) %&gt;%<br>  group_by(date) %&gt;%<br>  summarise(sum(xG))<br>df &lt;- rbind(df1, df2)</pre><pre>df3 &lt;- data %&gt;%<br>  filter(h_a == &quot;a&quot;) %&gt;%<br>  filter(home_team == &quot;Manchester United&quot;) %&gt;%<br>  group_by(date) %&gt;%<br>  summarise(sum(xG))<br>df4 &lt;- data %&gt;%<br>  filter(h_a == &quot;h&quot;) %&gt;%<br>  filter(away_team == &quot;Manchester United&quot;) %&gt;%<br>  group_by(date) %&gt;%<br>  summarise(sum(xG))<br>dfa &lt;- rbind(df3, df4)<br>dfa &lt;- dfa[, 2]<br>dfa &lt;- dfa %&gt;%<br>  rename(Away_xG = &#39;sum(xG)&#39;)</pre><pre>df &lt;- cbind(df, dfa)<br>df &lt;- df %&gt;%<br>  rename(Home_xG = &#39;sum(xG)&#39;) %&gt;%<br>  rename(Date = date) %&gt;%<br>  mutate(Home = &quot;Manchester United&quot;) %&gt;%<br>  mutate(Away = &quot;Misc&quot;)</pre><pre>df$Date &lt;- as.Date(df$Date)</pre><p>Then plot the data.</p><pre>plot_trendline(data = df, team = &quot;Manchester United&quot;,<br>               colour_xg = &quot;#08519c&quot;, colour_xga = &quot;#cb181d&quot;,<br>               roll_avg = 2, theme = &quot;dark&quot;)</pre><p>The resulting plot :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sc4ntOB9pMihiCIfUBT-_Q.png" /></figure><p>That just about concludes this tutorial. I hope this helped you in starting out with the R language. All of the code used in this tutorial can be found in this <a href="https://github.com/harshkrishna17/Miscellaneous-R/blob/main/R%20Tips%20and%20Tricks.R">GitHub file</a>.</p><p><em>You can reach out to me on my twitter account </em><a href="https://twitter.com/placehoIder2004"><em>here</em></a><em>.</em></p><p><em>Harsh.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42c1dc394756" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tammy Abraham : Scout Report]]></title>
            <link>https://harshkrishna17.medium.com/tammy-abraham-scout-report-3d7af3c9b4d2?source=rss-2dbcc7d56e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d7af3c9b4d2</guid>
            <category><![CDATA[soccer]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[chelsea]]></category>
            <category><![CDATA[video-analytics]]></category>
            <dc:creator><![CDATA[Harsh Krishna]]></dc:creator>
            <pubDate>Sun, 15 Aug 2021 09:10:05 GMT</pubDate>
            <atom:updated>2021-08-15T09:20:08.758Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GuNiKefmrrpi0iH22e97mw.jpeg" /><figcaption>“jose won’t ruin him! jose won’t ruin him!!”, i continue to insist as i slowly shrink and transform into a corn cob</figcaption></figure><h3>Tammy Abraham : Scout Report</h3><p>Tammy Abraham’s future is one of the stories of the current transfer window which has gotten lost in the deluge of all the big-money marquee signings and Messi to PSG and yada yada yada. With the recent signing of Romelu Lukaku by Chelsea, and the previous season signings of Timo Werner and Kai Havertz (who is occasionally used as a striker), Tammy is finding minutes hard to come by in West London. This has prompted him to look for minutes elsewhere and it is Jose Mourinho’s AS Roma that have secured his signature for a sum of 40 million Euros.</p><h3>The Story So Far</h3><p>Some basic information about Abraham :-</p><ul><li>English/Nigerian citizenship</li><li>23 years old</li><li>1.90 m tall</li><li>Right-footed</li></ul><p>Tammy’s 6ft 3in frame might look lanky, but he has enough strength to contend with the most physical of defenders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdBQvI4oqvN1rxKYQheKVw.jpeg" /></figure><p>Moving on, here is a look at how Tammy has seen his minutes of football since breaking out in the 2015/16 season.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-llHao871n7aA_znchbTg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn38ZrnnPKOijqhe80UppA.png" /></figure><p>After a couple of games off the bench for Chelsea in his breakout season, he was loaned out to Bristol City FC in the EFL Championship where he played a significant amount of minutes with the club, scoring 25 goals. This helped the club beat the drop and come 17th. Abraham then had spells with Swansea in the Premier League and then Aston Villa in the Championship, the latter where he played a key role in helping Dean Smith’s side gain promotion to the Premier league through the playoff’s, scoring 25 goals along the way. His loan merry-go-round ended when he was finally given a chance at Chelsea by Frank Lampard, a chance which he took with both hands, firing in 15 goals and 3 assists in his first full Premier League season, helping Chelsea’s young side secure a Champion’s League spot.</p><p>Let’s dig into Tammy’s career so far with the help of data and video.</p><h3>Data Analysis</h3><p>What do Tammy’s underlying’s with respect to his finishing say about his time in Professional football so far?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lnj9U_dCKTy79mAEnN24cw.png" /></figure><p>This graph only contains data from his seasons in the Premier League, so discrepancies are expected, but in general, Tammy has had a pretty OK-ish performance relative to his xG.</p><p>As his minutes under Tuchel dried up, so did his ability to consistently deliver and take the chances afforded to him, trapping him in a vicious cycle from which he is now attempting to break free by securing a move away.</p><p>The next chart also shows us how Abraham has always been an above average striker with respect to the quality and quantity of his shots, even being amongst the best forwards in the top 5 leagues in accumulating non-penalty xG.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nF_cowsM6F9Kamxs9cp5ww.png" /></figure><p>Finally, a look at his scouting report over the last 365 days gives us a quick summary of Tammy’s strength’s and weaknesses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*OnKiuXERvEshNSRTLf7Q3A.jpeg" /></figure><p>While his attacking play in general is quite good, there is stuff in the domain of on ball effectiveness and contributions to the team defending as a unit that is left to be desired.</p><p>Tammy Abraham will score you goals. If you want a young striker that is effective at putting balls in the back of the net, you needn&#39;t look much further than him.</p><p>Next up, we dig into the how and why of him being good at scoring goals, as well as the things that he has to improve on to become a world class forward.</p><h3>Video Analysis</h3><p>Tammy’s movement in the box is one of his best attributes. He has the great ability to create space for himself in the box, and a variety of different weapons in his arsenal to finish off the chances that he gets. Here is an example of Tammy’s clever movement which ultimately results in him scoring a goal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*xVx8IlQbr4pjKrQVdK6HsQ.gif" /></figure><p>Tammy also has an excellent “striker’s instinct”, i.e. the ability to smartly read opposition players and the ball to make optimum usage of each situation. He is great at reading loose balls in and around the box, which allows him to pounce on many exciting opportunities, which often ultimately result in goals.</p><p>Here is a clip demonstrating Abraham’s great poaching ability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*oyV6HoNuyI3yl0aiyKkEaw.gif" /></figure><p>He also has a great ability to isolate a man and use his physicality to overcome him, such as the examples shown in this clip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*dmJqfCov_V-B9SIvOWI_0A.gif" /></figure><p>And of course he has the awareness to find space to leave himself unmarked in the box for easy tap-ins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*wriYFxtR5x5T1OveROj-fg.gif" /></figure><p>His contribution to a team’s overall play isn’t much compared to other top striker’s in the world. Here is an example of him dropping deep and initiating a dribble to win his team a corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*h9QxeowTPk_05Ic9xKUa5A.gif" /></figure><p>However, there is a distinction to be made between Tammy’s effectiveness on the ball in settled possession and in transition. While his on-ball endeavors in settled possession could use work, he is better in contributing to the team in transition situations.</p><p>Another thing that he doesn’t do more of is beating his man one-on-one. Here’s one example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Cqu8pDIRBGd_u3QzV0pqDg.gif" /></figure><h3>Chelsea F.C.</h3><p>Looking deeper into Tammy’s time at Chelsea, we can gain more crucial information about him as a player, and a more representative look at what can be expected of him at his new club.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-iTeMWhlaXCzkoG3WRp7g.png" /><figcaption>Courtesy of SofaScore</figcaption></figure><p>Firstly, a look at his heatmaps for the Premier League seasons suggest that his role has not changed, rather only the amount of minutes played. He does occasionally drop deep to link up play (as is expected of any striker at a top club these days), however, he mostly concentrates his touches of the ball in the penalty area, the place from where he can cause the most damage, something that is corroborated by his shot map over the past two season’s as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iK1vSKvwqJaCROrvcOvMrQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bg28rp5t5wZ-o3LRINmlDA.png" /><figcaption>Data from Understat</figcaption></figure><p>Another interesting aspect that has been talked about with respect to Tammy’s prospective move (for Arsenal fans) to Arsenal has been the development of a connection with their LB Kieran Tierney. Looking at the locations of the shots that Tammy has taken, assisted by full-backs, we see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*5OFvGcq-r0z5nN47FBNtdQ.png" /></figure><p>It is also extremely important to note that of the players that have assisted the shots in his top-flight career so far, Reece James and Cesar Azpilicueta rank 3rd and 4th respectively with 10 and 9 shot-assists each.</p><p>Not only combining with his teammates in terms of value from scoring situations, Abraham is also effective at using his great movement for the benefit of his teammates, as is demonstrated in this following clip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*y6ar0SNuQ6MahfUennIRLA.gif" /></figure><h3>Final Overview</h3><p>Here is a final assessment of Tammy, summarizing all that we have talked about so far, and more.</p><h4>Strength’s</h4><p>Tammy is a tall striker who is quite strong on and off the ball in duels despite his wiry frame.</p><p>His movement in the box is superb, not only creating space for himself, but also for his teammates, displaying superb spatial awareness of opponents and the ball.</p><p>He is extremely receptive towards loose balls in and around the box, allowing him to be always ready to pounce on then and claim “true striker’s goals”.</p><p>Abraham is generally quite an aggressive pressor, though that could be more due to instruction by manager than a tendency of the player. Regardless, he’s not going to press much under Jose at Roma so it doesn’t really matter that much does it?</p><h4>Weaknesses</h4><p>Tammy still has to improve on his ability on the ball, and his ability to influence the game without scoring goals. His link-up play in settled possession is below-par of what is expected of a striker at a top European club.</p><p>His heading could use some work, and his finishing in general is quite OK (as said before) but has underperformed in 2 of the 3 seasons for which FBref collects xG data.</p><p>He seems to think a bit when going one-one, so he could work on making his finishing a bit more instinctive.</p><h3>A.S. Roma</h3><p>Let’s assess the suitability of Tammy to his new club, Roma.</p><p>While I would definitely prefer for him to move to either of Atalanta(Luis Muriel go brrrr) or Arsenal(The prospect of a Tierney-Tammy link-up appeals to me very much, though, I suppose a similar partnership could be struck with Spinazzolla, assuming Jose hasn’t sucked out either of their souls by then), there are definite positives towards his move to Rome. Of course, Roma are getting the better end of the deal here. They manage to replace Edin Dzeko with a young, dynamic striker who is sure to score them goals. For Tammy, on the other hand, he goes to a place where he get’s to play football. Minutes is better than no minutes, right?</p><p>Tammy get’s to show his worth, hopefully securing him a big money move to another top European club, or Chelsea can just buy him back for an obscene amount of money (yeah, Chelsea, we’re onto you).</p><h3>Conclusion</h3><p>Wherever Tammy goes, I’m sure that he has the necessary tools to succeed. A very successful career awaits for him, so Jose Mourinho, please, oh please for the love of god, do not go full Jose on him.</p><p>Also, a young striker who has great awareness of his surroundings, must be nice…… (Man Utd fan cries).</p><p>You can contact me at my twitter account <a href="https://twitter.com/ftblhk">here</a>.</p><p>Hope you enjoyed reading this.</p><p>Harsh.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d7af3c9b4d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Dumbbell Charts in R]]></title>
            <link>https://medium.com/analytics-vidhya/creating-dumbbell-charts-in-r-547ab863c86b?source=rss-2dbcc7d56e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/547ab863c86b</guid>
            <category><![CDATA[soccer]]></category>
            <category><![CDATA[r-programming]]></category>
            <category><![CDATA[soccer-analytics]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Harsh Krishna]]></dc:creator>
            <pubDate>Sun, 18 Jul 2021 09:00:28 GMT</pubDate>
            <atom:updated>2021-07-30T11:36:51.901Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUwBzFBsx383ZJ2c51hlyg.jpeg" /><figcaption>The plots look a little different.</figcaption></figure><h4>And otheR stuff</h4><p>This is the first tutorial I’m writing for R, in which I’m hoping to tackle a variety of topics, including creating “dumbbell charts” and other stuff in R that can be used for any visualization that you hope to make using ggplot2.</p><h3>What is R?</h3><p>R is a programming language which is used (primarily) by statisticians for statistical (duh) and graphical purposes. It can create powerful plots which are highly customizable. To get started with R, <a href="https://cran.r-project.org/bin/windows/base/">download the base version of it from the internet</a>. Now, the usage of the base version of R is quite cumbersome and tedious, thus most people make use of IDE’s (Integrated Development Environment’s) which are wrappers around base R, that make the usage of the language easier. RStudio is by far the most popular of these IDE’s and <a href="https://www.rstudio.com/products/rstudio/download/">you can download it here</a>.</p><h3>What are Dumbbell Charts?</h3><p>Next up, lets talk about what “dumbbell charts” are and what they are useful for. A dumbbell plot (can also be called a barbell plot) is ideal for illustrating change and comparing the distance between two groups of data points. It looks like a dumbbell, hence the name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMCh3yQ59wmBNQP4zUHPKQ.png" /></figure><p>In the sphere of football analytics, it has various uses, including showing the differences between team performances home and away, which is what we will be using as an example in this tutorial.</p><p>Now that we have the basics out of the way, let’s go about making the chart.</p><h3>Getting the Data</h3><p>Once you have opened up RStudio, you will see something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgXPUZDH6DJxJcd6VjAzzA.png" /></figure><blockquote>Cool tip: In case you wanted to change the appearance of your RStudio window (like I have), you can do so by going to Tools &gt; Global Options &gt; Appearance. You can change the layout to your liking.</blockquote><p>Now, the data for the chart is from <a href="https://fbref.com/en/">FBref</a>. You can extract the data from the website directly in the form of an excel sheet, before reading the data into R, but that is kinda tedious, and unnecessary. Instead, we can use specific packages that will get the data into RStudio for us. All we need to do is write the code. The package in this case is <a href="https://jaseziv.github.io/worldfootballR/">WorldFootballR </a>created by <a href="https://twitter.com/jaseziv">Jason Zivkovic</a>. Let’s get to the coding part (pew pew!!) (sorry wont do that again).</p><p>The Rscript (where you write your code) is done on the pane on the top right.</p><pre>install.packages(&quot;devtools&quot;)<br>remotes::install_github(&quot;JaseZiv/worldfootballR&quot;)<br>library(worldfootballR)</pre><blockquote>When writing code in R, the usage of “” is very important. The parts within the quotation marks will be highlighted differently to the other parts of the code. Make sure not to miss out on writing any (or don’t even write any extra ones) (yeah, I know, its confusing that way).</blockquote><p>Next up, to extract the data from FBref, we go</p><pre>league_table &lt;- get_season_team_stats(country = &quot;FRA&quot;, gender = &quot;M&quot;, season_end_year = &quot;2021&quot;, tier = &quot;1st&quot;, stat_type = &quot;league_table_home_away&quot;)</pre><p>Now, this part is pretty self explanatory. The “&lt;-” is important in getting the data into your environment, which is to the right hand side of where you write your code.</p><p>You can also check out the package to see how you can get the data for other metrics as well. It is all well specified and easy to use.</p><h3>Other Packages</h3><p>Now, the WorldFootballR package is for getting the data, but there are several other packages that shall be used for the creation of plots in R. They go as follows</p><pre>install.packages(&quot;ggplot2&quot;)<br>install.packages(&quot;tidyverse&quot;)<br>installed.packages(&quot;ggtext&quot;)</pre><pre>library(tidyverse)<br>library(ggplot2)<br>library(ggtext)<br>library(dplyr)<br>library(ggalt)</pre><p>Let me go over what each of these packages and what they do</p><ol><li>ggplot2 :- Creating graphics.</li><li>tidyverse :- A collection of packages that include design and grammar.</li><li>dplyr :- Manipulation of datasets. Included in tidyverse.</li><li>ggtext :- Text stuff.</li><li>ggalt :- Includes different functions such as the geom() set of functions. Comes within the ggplot2 package.</li></ol><h3>Data Manipulation</h3><p>Okay, so now that we have got the data, let’s manipulate it a bit.</p><pre>data1 &lt;- league_table[, c(5, 14, 19, 27, 32)]</pre><pre>data1$xGDiff_Home &lt;- data1$GD_Home - data1$xGD_Home<br>data1$xGDiff_Away &lt;- data1$GD_Away - data1$xGD_Away</pre><p>So what I’ve done here is select specific columns and rows from the dataset “league_table” and called it “data1”. In the next two lines, I have created two new columns (the columns that we shall use to create the dumbbell plot). You can also add another line to have only the columns that we need.</p><pre>data1 &lt;- data1[, c(1, 6, 7)]</pre><p>I’ve filtered down the dataset “data1” to the same name, to avoid confusion. Your dataset should now look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6nX7Z029e8Mq7YGeVyxWOQ.png" /></figure><blockquote>Tip for later use: When selecting specific rows and columns, we should note that the code is written in the form of :- dataset[rows, columns].</blockquote><blockquote>For example, to select the first two rows and all columns of a dataset, we use</blockquote><pre>dataset[c(1, 2),] #example</pre><blockquote>Another tip for use: A ‘#’ before anything in R means that R will not read it as part of the code. Thus, it can be used to explain stuff in the script itself so you don’t forget steps.</blockquote><p>And finally let’s add another line to transform the column listing club names to characters</p><pre>data1$Squad &lt;- factor(data1$Squad, levels=as.character(data1$Squad))</pre><h3>Plotting</h3><p>The main event. Let’s begin. Enter this code.</p><pre>ggplot(data1, aes(x=xGDiff_Home, xend=xGDiff_Away, y=Squad)) + <br>  geom_dumbbell()</pre><p>And lo and behold! Its a dumbbell chart!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nuCffhhYzUTy2SBKKPmGw.png" /></figure><p>But really, this is just the bare bones of the chart and there is a lot of work yet to be done. The next part of code is long, and it is applicable for the creation of dumbbell charts with any datasets. Lets go step by step.</p><pre>p1 &lt;- ggplot(data1, aes(x=xGDiff_Home, xend=xGDiff_Away, y=Squad))</pre><p>This is the same line as before. It concerns stuff that make the majority of out plot. Now, if your wondering why I have defined this as ‘p1’, we will get to that soon. Next, we take care of the bar and circles that give our plot it’s name.</p><pre>p2 &lt;- geom_segment(aes(x=xGDiff_Home, <br>                   xend=xGDiff_Away, <br>                   y=Squad, <br>                   yend=Squad), <br>               color=&quot;#b2b2b2&quot;, size=3)</pre><pre>p3 &lt;- geom_dumbbell(color=&quot;light blue&quot;,         <br>                size_x=10,                  #size of circle1<br>                size_xend =10,              #size of circle2<br>                colour_x=&quot;#238b45&quot;,         #colour of circle1<br>                colour_xend = &quot;#fe9929&quot;)    #colour of cirlce2</pre><p>Next, the title and the subtitle.</p><pre>TS &lt;- labs(x=NULL, y=NULL, <br>       title=&quot;&lt;b style=&#39;color:#ffffff&#39;&gt;Overperformance or Underperformance ? (2020/21)&lt;/b&gt;&quot;, <br>       subtitle=&quot;&lt;b style=&#39;color:#ffffff&#39;&gt;How have Ligue 1 teams performed on their Goal Difference&lt;/b&gt; <br>&lt;b style=&#39;color:#238b45&#39;&gt;Home&lt;/b&gt; &lt;b style=&#39;color:#ffffff&#39;&gt;&amp;&lt;/b&gt; <br>&lt;b style=&#39;color:#fe9929&#39;&gt;Away&lt;/b&gt; &lt;b style=&#39;color:#ffffff&#39;&gt;?&lt;/b&gt;&quot;)</pre><pre>TS1 &lt;- theme_classic(base_size = 24) +<br>  theme(plot.title = element_markdown(lineheight = 1.1),<br>        plot.subtitle = element_markdown(lineheight = 1.1))</pre><p>Let’s add a caption to the chart as well.</p><pre>TS2 &lt;- labs(fill=&quot;&quot;,                                                                       <br>       caption = &quot;Data from FBref via StatsBomb, WorldFootballR<br>       Created by Harsh Krishna&quot;)</pre><p>Let’s put together all that we have so far.</p><pre>plotlight &lt;- p1 + p2 + p3 + TS + TS1<br>plotlight</pre><p>Lets take out an image of it. Click on ‘export’ on the panel above where our plot lies and set the dimensions as 2000x1000.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HBJvyaLSqdP7F-Ru_gog6A.png" /></figure><p>Check out the image. You might notice that the title is not visible at all. That is because I prefer my plots to be of a dark theme. I have already coded the title and subtitle of the plot to be white in colour. Lets take a look at that specific section of code in more detail.</p><pre>labs(x=NULL, y=NULL, <br>       title=&quot;&lt;b style=&#39;color:#ffffff&#39;&gt;Overperformance or Underperformance ? (2020/21)&lt;/b&gt;&quot;, <br>       subtitle=&quot;&lt;b style=&#39;color:#ffffff&#39;&gt;How have Ligue 1 teams performed on their Goal Difference&lt;/b&gt; <br>&lt;b style=&#39;color:#238b45&#39;&gt;Home&lt;/b&gt; &lt;b style=&#39;color:#ffffff&#39;&gt;&amp;&lt;/b&gt; <br>&lt;b style=&#39;color:#fe9929&#39;&gt;Away&lt;/b&gt; &lt;b style=&#39;color:#ffffff&#39;&gt;?&lt;/b&gt;&quot;) +<br>  theme_classic(base_size = 24) +<br>  theme(plot.title = element_markdown(lineheight = 1.1),<br>        plot.subtitle = element_markdown(lineheight = 1.1)) +<br>  labs(fill=&quot;&quot;,                                                                       <br>       caption = &quot;Data from FBref via StatsBomb, WorldFootballR<br>       Created by Harsh Krishna&quot;)</pre><p>Any text can have its colour altered by putting it between “”&lt;b style=’color:#ffffff’&gt;” and “&lt;/b&gt;”. If you like you plots with a white background, you can go ahead remove only that specific section of code (except for ‘Home’ and ‘Away’).</p><p>If you’re wondering how to find the hex colours for R, <a href="https://colorbrewer2.org/#type=sequential&amp;scheme=BuGn&amp;n=3">here is a handy-dandy tool to do just that</a>.</p><p>For those of you that like a plot with a dark background, let’s go forward. To change the plot and panel background colour, as well as change the caption text colour, we do</p><pre>themes1 &lt;- theme(plot.background = element_rect(fill = &quot;#000000&quot;, colour = &quot;#000000&quot;)) +<br>          theme(panel.background = element_rect(fill = &quot;#000000&quot;, colour = &quot;#000000&quot;)) +<br>          theme(plot.caption = element_text(color = &quot;white&quot;))</pre><p>Let’s do some stuff for the axes.</p><pre>themes2 &lt;- labs(x = &quot;GD - xGD&quot;)</pre><pre>themes3 &lt;- theme(axis.title.x = element_text(colour = &quot;#ffffff&quot;)) <br>          <br>themes4 &lt;- theme(axis.text.x = element_text(colour = &quot;#ffffff&quot;),<br>                 axis.text.y = element_text(colour = &quot;#ffffff&quot;))</pre><p>And finally, let’s add some gridlines and axis lines.</p><pre>themes5 &lt;- theme(panel.grid.major = element_line(colour=&quot;grey&quot;, size = (0.1)), panel.grid.minor = element_blank()) +<br>          theme(panel.grid.major.y = element_blank()) + <br>          theme(axis.line = element_line(size = 0.8, colour = &quot;#ffffff&quot;))</pre><p>Let’s bring it all together once again.</p><pre>DBplot &lt;- p1 + p2 + p3 + TS + TS1 + TS2 + themes1 + themes2 + themes3 + themes4 + themes5<br>DBplot</pre><p>Now, our plot looks complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiCOdkkoat87fQ4mQDYAMw.png" /></figure><p>Buuuuut, maybe just add one teeny-tine last thing. We can highlight a section of the panel (less than 0) as the section where teams that underperform lie. We want it to be red in colour (some might argue underperformance might be good, but whatever dude), and we also want it to be kinda transparent. Lets do this using a function called geom_rect().</p><pre>DBplot + geom_rect(aes(xmin = 0, xmax = -Inf, ymin = -Inf, ymax = Inf), <br>fill = &quot;red&quot;, alpha = 0.01)</pre><blockquote>You can play around with this and see what look suits your plot. ‘alpha’ is for setting the transparency. ‘Inf’ stands for infinity, and make careful use of the minus sign before it.</blockquote><p>Phew! It looks good, EXCEPT (I’m so sorry, just one last ride, the fast and furious franchise are furious at me for stealing their flow, huh?) the rectangle appears above the plot. Now, I’m sure there is some fancy function to fix this, but I don’t know of that and truly speaking, I don’t care. To fix, just add all the stuff you had defined beforehand, except for p1. (now you see why we defined all that stuff earlier, it’s all just to make our code cleaner).</p><pre>DBplot + geom_rect(aes(xmin = 0, xmax = -Inf, ymin = -Inf, ymax = Inf),<br>fill = &quot;red&quot;, alpha = 0.01) + <br>  p2 + p3 + TS + TS1 + TS2 + themes1 + themes2 + themes3 + themes4 + themes5</pre><p>And believe it or not, we are done!</p><p>All of this will lead to this final plot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gK99Z-5kr_mtYYO0OyrOg.png" /></figure><p>To check out the code in its full glory, you can click <a href="https://github.com/harshkrishna7/R-Code/blob/main/Dumbell%20chart%20R">here</a>.</p><p>This was inspired by a guide by RPubs that can be found <a href="https://rpubs.com/ageek/ggplot-adv-part2">here</a>.</p><p>Thanks to <a href="https://ninad06.medium.com/">Ninad Barbadikar</a> for his inputs on this tutorial.</p><p>If you have any doubts or questions, you can reach out to me <a href="https://twitter.com/ftblhk">here</a>.</p><p>Hope you found this helpful!!</p><p>Harsh.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=547ab863c86b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/creating-dumbbell-charts-in-r-547ab863c86b">Creating Dumbbell Charts in R</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Waffle Charts in Tableau]]></title>
            <link>https://medium.com/analytics-vidhya/creating-waffle-charts-in-tableau-a6a8f9e31898?source=rss-2dbcc7d56e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6a8f9e31898</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[soccer]]></category>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[football-analytics]]></category>
            <dc:creator><![CDATA[Harsh Krishna]]></dc:creator>
            <pubDate>Sun, 11 Jul 2021 10:08:08 GMT</pubDate>
            <atom:updated>2021-07-26T06:11:04.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8lNnSKc3CXl0z7ruXTXeMA.jpeg" /><figcaption>Delicious!!</figcaption></figure><h4>I sincerely say that I am, in fact, not waffling.</h4><p>Hey there! This tutorial is attempting to take its readers through every step of the process in creating waffle charts in tableau using football data. If you are familiar with the sports analytics arena, you might have seen these quite frequently.</p><p>What does it do?</p><p>A waffle chart shows the completion percentage, or the components of a whole in % form. It is basically a fancier pie chart, only less cluttered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/0*0ana8RcgtjBSR8oq.png" /></figure><p>Now, some of you may ask me, Harsh, this looks nothing like a waffle. More like a large square with smaller squares inside it. Why in god’s name is it called a waffle chart?</p><p>Well, yes, but also no. As it turns out, you learn something new everyday, and what I learnt today was that square waffles are a very real thing. You can think of the name serving a dual purpose, it sort of looks like a waffle, but in some ways isn’t a waffle. The name waffle chart itself is waffle.</p><p>(Okay, I’ve realized I’m wasting your time, so I’ll get straight to the tutorial)</p><p>Let’s get waffling!!</p><h3>Getting the data</h3><p>The data for this visualization is from Football Reference. For this tutorial, I shall be using the <strong>Goal-Creating Actions (GCA)</strong> for teams in the German Bundesliga. You can find the dataset from the website <a href="https://fbref.com/en/comps/20/Bundesliga-Stats">here</a>.</p><p>Once you have the data opened up in Excel, you can go ahead and trim out all the excess and (for the sake of this tutorial) unnecessary data. Your data should now look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GFUZwTv5uzIu4Xtd.png" /></figure><p>(Note: I have copy pasted this sheet onto a new worksheet before saving it, because I did not extract the data in the form of a CSV. The dataset is saved in the form of an excel workbook named <strong>“Bundesliga GCA 3.0”</strong>)</p><h3>Tableau Data Prep</h3><p>Open Tableau and load up your data. What you have to do now, is select all the columns except the column named “Squads” and “GCA”. If you’re on Windows, you can simply Hold down the ctrl key and select the columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hg15ab_wmIp2JA-V.png" /></figure><p>You will see that I have right-clicked and chosen the <strong>pivot</strong> option. Tableau will now provide you with the pivot fields that you require to make the waffle chart. Your table will now look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xihNmmR24T9ia6Im.png" /></figure><p>Rename “Pivot Field Names” to “GCA Types” and “Pivot Field Values” to “Values”.</p><p>Cool? Cool. Now open up the Worksheet. Now you want to open up a new data source on the same sheet. The new dataset that you will enter is the template for your waffle chart. Click on the link below to download it.</p><p><a href="https://docs.google.com/spreadsheets/d/e/2PACX-1vThwvmaCKGZy4OlhLNFwRYYL_3yMM-95h2M_zWVgFeL9h8WgGK-_I8gLimltuBnt-NRAQeQL4ol0ark/pub?output=ods">Waffle Template</a></p><p>You can make this yourself (quite easy to do) or you can copy paste these values to a new Excel worksheet and save it.</p><p>Okay. Convert ‘Rows’ and ‘Columns’ into Dimensions and drag both of them to their respective drop-boxes. It is recommended you right-click on ‘Rows’ and sort it in the descending order. Change the mark type to ‘Square’ and drag on the table from the bottom and right-hand side to enlarge the viz. Adjust the size of the squares through the size slider. Hide both the headers. You should also click on borders under Format and change Pane under ‘Row Divider’ to None. All in all it should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lntcI4V7DTdpelc_.png" /></figure><h3>Calculated Fields</h3><p>Click on the original data source (Bundesliga GCA 3.0) and start creating calculated fields.</p><p>I’ve named my calculated fields as GCA 1 through to 6 (6 fields in total).</p><pre>SUM(IF [GCA Types] = &quot;Pass Live&quot; THEN [Values] END)</pre><pre>/ SUM([Values])</pre><p>What we are doing here is creating the value ratios of all the categories available to us.</p><p>Use this as an example to create the other 6 calculated fields, keeping everything the same apart from the section within the quotation marks which while include <strong>“Pass Dead”, “Sh”, “Def”, “Drib”, “Fld” </strong>and<strong> “Blanks”.</strong></p><p>Reference Photo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P0FxgQn3K3e20gUl.png" /></figure><p>Great. Now switch over to the <strong>“Waffle Template”</strong> dataset and create a new calculated field. I have named this field <strong>“Final”</strong>. Copy paste this onto there.</p><pre>IF AVG([Percentage]) &lt;= [Sheet1 (Bundesliga GCA 3.0)].[GCA 1] THEN &quot;Pass Live&quot;</pre><pre>ELSEIF AVG([Percentage]) &lt;= [Sheet1 (Bundesliga GCA 3.0)].[GCA 1] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 2] THEN &quot;Pass Dead&quot;</pre><pre>ELSEIF AVG([Percentage]) &lt;= [Sheet1 (Bundesliga GCA 3.0)].[GCA 1] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 2] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 3] THEN &quot;Sh&quot;</pre><pre>ELSEIF AVG([Percentage]) &lt;= [Sheet1 (Bundesliga GCA 3.0)].[GCA 1] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 2] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 3] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 4] THEN &quot;Def&quot;</pre><pre>ELSEIF AVG([Percentage]) &lt;= [Sheet1 (Bundesliga GCA 3.0)].[GCA 1] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 2] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 3] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 4] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 5] THEN &quot;Drib&quot;</pre><pre>ELSEIF AVG([Percentage]) &lt;= [Sheet1 (Bundesliga GCA 3.0)].[GCA 1] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 2] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 3] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 4] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 5] + [Sheet1 (Bundesliga GCA 3.0)].[GCA 6] THEN &quot;Fld&quot;</pre><pre>ELSE &quot;Fld&quot; END</pre><p>Now, drag <strong>Final </strong>to “Color” under Marks and Drag squad to filters. Select the squad of your choice and THAT IS IT!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uD5ViNZ_rpGLjP0-.png" /></figure><p>Adjust the Colours and the background to your liking and your waffle chart is good to go.</p><h3>Version 2.0</h3><p>Now, these graphs are great for showing the percentage of each category in proportion. But, what if you wanted to show the data disproportionately? Maybe I’m not wording this as well as I could but what I mean to say is, if you wanted to show the top GCA teams, then you might need a different type of graph. Something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QMIkdDy4y1PxGJta.png" /></figure><p>To do this, you need to make a small modification in the early steps of this process. This brings us back to our Excel sheet. Create a new Colum called <strong>Blanks. </strong>In this column, you need to calculate the highest GCA — Every other teams GCA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*a9BRhP153Rwme3_5.png" /></figure><p>We see that Bayern Munich has the highest GCA in the league. Thus we subtract every other teams GCA from it.</p><p>We then do all the same steps done before, until the part to the creation of calculated fields, where we now will make one extra field namely<strong> “GCA 7”</strong> with it referencing the category Blanks, with the same formula we had used before.</p><p>Then in the next formula we add another line with the same cumulative pattern going up to GCA 7, and now end with</p><pre>ELSE “Blanks” END</pre><p>We then edit the colours of the chart so that the colour of the legend “Blanks” is the same as the background, hiding it, and making it, well blank.</p><p>And that’s the whole thing.</p><p><em>This tutorial references a guide written by “Recnac”. You can find it </em><a href="https://www.pluralsight.com/guides/tableau-playbook-waffle-chart"><em>here</em></a><em>.</em></p><p>Thanks to Swaminathan Nanda Kishore for the help in my understanding of version 2.0.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6a8f9e31898" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/creating-waffle-charts-in-tableau-a6a8f9e31898">Creating Waffle Charts in Tableau</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Psychology behind Automatisms]]></title>
            <link>https://harshkrishna17.medium.com/the-psychology-behind-automatisms-d424d073c46e?source=rss-2dbcc7d56e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d424d073c46e</guid>
            <category><![CDATA[football]]></category>
            <category><![CDATA[soccer]]></category>
            <category><![CDATA[sports-analytics]]></category>
            <category><![CDATA[football-tactics]]></category>
            <dc:creator><![CDATA[Harsh Krishna]]></dc:creator>
            <pubDate>Sun, 11 Jul 2021 09:53:12 GMT</pubDate>
            <atom:updated>2021-07-11T09:53:12.648Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6SD0mvhqo-XUqRIOdWFnpA.jpeg" /></figure><h4>Why brushing your teeth in the morning hold’s the key to understanding modern football.</h4><p>In biology, <strong>evolution</strong> is the change in the characteristics of a species over several generations.</p><p>Now, this is applied to living species. But can it be applied to a inanimate object, a frame of mind, basically a thought? Can it be applied to sports? How about football?</p><p>The dictionary meaning of evolution <strong>can </strong>in fact be applied to the sport of football. The characteristics that have defined football have kept on changing throughout generations. When once, the idea of freedom and emphasis on players finding solutions for themselves prevailed, its now been replaced by a systems of predetermined actions, (<em>fancy word alert</em>) <strong>automatisms.</strong></p><p>The dictionary meaning of an automatism goes as</p><blockquote>The performance of actions without conscious thought or intention.</blockquote><p>Unless you’ve been living under a rock, the increasing use of terms such as “patterns of play” , “system” or even the practice of playing in “circuits” must not be anything new to you. All these point to the existence of automatisms in a teams play, and that existence has a root in the science of psychology.</p><p><strong>Why is this?</strong> Lets start from the beginning.</p><p>Football is an energy intensive sport. The various phases of play, from defense to attacking transition to attack to defensive transition, all require the expense of energy. This plus the impact of pressing in this so called current “pressing age” has had a hand in exhausting a player so much more than usual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9SARh8CSq4TC7bOi.jpeg" /></figure><p>What is the end result of this? Very tired players. <strong>Duh</strong>.</p><p><strong>So what exactly happens when a mind is tired?</strong></p><p>Our regular brain activity is a complex system of impulses that help us create solutions in real time. Whenever we see a problem, our brains start working furiously in order to find a solution. However, when a brain is tired, the brain signals weaken/slow down and the ability to make decisions within a split second is gone. Fatigue restricts people from making decisions off the cuff.</p><p>The decisions that we make when tired are more often than not, habits.</p><p><strong>Next question, what are habits?</strong></p><p>Let us create a situation. When you wake up in the morning, what was the first thing you did? I suppose brushing your teeth. (Unless of course you’re one of those weird people that brushes in the shower, but hey, I’m not judging). Whether be it brushing your teeth, or getting into the shower, or even both simultaneously, all of this is dictated by our habits. We don’t think of doing it. We don’t contemplate on different things we could do. We just do something, and that something is subconsciously/unknowingly done. A research published by Duke University in 2006 said that 40% of the actions that people perform in their daily lives weren’t even decisions, they were just habits.</p><p><strong>Now, how does the science of habits fit into the new vision of automatized possession play in football?</strong> <em>(Hey, look at me using big words of which I hardly know the meaning).</em></p><p>Let us take the example of one of the most famous academies in European football, La Masala. Ummmmmm, La Masia (Go away Joe, I told you that you can’t write here). Sorry about that.</p><p>Anyway, quoting a line from SkillSkoolSoccer *whataname*</p><blockquote><em>“</em>It is said that FC Barcelona does not directly teach tactics to young players at La Masia, and instead they focus on <strong>automatisms</strong>.</blockquote><p>Now, saying that tactics are not taught would seem like kind of a crass oversimplification. However, The overarching idea behind the statement was that there is greater emphasis on teaching players about actions that may help them in the event of wanting something to fall back on. The ideas of football, what to do in and out of possession, and the transitions between the 2 events are the things that the academy hopes to instill, or <strong><em>habituate</em></strong> into the kids.</p><p><strong>So how exactly do you start the process of habituation?</strong></p><p>The basis of habit formation, is based on 3 things that repeat itself continuously to form a loop. The 3 components in question are a cue, a routine and a reward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*EPbdMezwEDPoJ2dV.png" /></figure><p>A cue is what starts/elicits the routine or the action. That action leads to a reward. This cycle continues throughout our lives. Let us take an example with regard to football.</p><p>While attacking, whenever a player sees a certain teammate carrying the ball forward, (depending on the position of the player in question) he realizes that he has to move wider in order to stretch the opposition backline horizontally and hence, facilitate better play.</p><p>The concept of positional rotations also have a basis in this. A player notices a cue, which sends him a signal. The player is drilled to elicit a certain response when noticing the cue, and subconsciously performs the routine (positional rotation) which leads to the reward, (better ball progression).</p><p>Players need a framework to fall back on when regular ideas don’t work. That framework is dictated by our habits. Those habits are drilled into the players. That is what, in my opinion, is coaching.</p><p>All of these principles, also known as “The golden rule of habit change” were used by coach Tony Dungy for the Tampa Bay Buccaneers, and later the Indianapolis Colts. In doing so he revolutionized the sport of football (American football, damn you, you Americans).</p><p>Here I would like to point out what in my opinion is the optimal combination for success in team sports. To do this, the concept of differential learning is to be understood.</p><blockquote>“It’s a really modern and dynamic coaching method that encourages players to think within a system.”</blockquote><blockquote><em>- Calvin Betton (Sports coach)</em></blockquote><p>Players should ideally be able to figure out solutions for most problems by themselves. The concept of differential learning aims to combine that with putting the player in the best possible position to make decisions for themselves. However, when players become too accustomed to a particular system, they lose the ability to think for themselves, leading to them losing control in high pressure situations.</p><p>This was one of the problems with Dungy’s coaching methods. Due to the intense coaching and predictable patterns, his teams often played tight games. The main point of his methods was to minimize decision making, thus allowing for quicker actions. The basic principle was :- “You don’t need more variation, you just need to be faster with what you do.”</p><p>The problem, as stated above lead to his teams often losing the deciding games in a season. Whenever they came to the closing stage of the season, they would ‘choke’ or ‘bottle’ their chance to go to the Super Bowl.</p><p><strong>Why?</strong> Because as soon as they were put in a high pressure situation, they would start losing their habits and start thinking too much. That was primarily because they did not have full faith in his methods. They did not fully believe in him or themselves.</p><p>Humans are creatures that need motivation. I personally believe that humans work around a system of reinforcement and/or punishment. Motivation is what guides us, but what gives us motivation is what is the ultimate deciding factor.</p><p>Let me give you the example based off Alcoholics Anonymous. Even though it has been widely criticized for the lack of a ‘scientific approach’ in its treatment stages, it still is very effective. Why is that? Because, AA gives people something to believe in (in this case, god) in addition to the change in habit routines. The principle of habit change works better when people have something to believe in, something that provides them comfort in the sense that it would guide them across difficult times. In sports, this can be simplified to a single term: <strong>Man-management</strong>.</p><blockquote>“If you have limited tactical knowledge, you can still be a successful coach. On the other hand, if you’ve great tactical qualities, but you’re not good with man management, you’ll never be successful.”</blockquote><blockquote><em>- Julian Nagelsmann</em></blockquote><p>Thus, I believe that sports management constitutes 3 major components: Tactics, coaching and man-management.</p><p>The idea of what you want to do in theory, the application of it in a practical sense and the ability to have your player buy into your ideas. In my opinion, all of these principles/ideas work in tandem to give a team the best chance of winning.</p><p><em>The idea for this was taken from a book called “The Power of Habit, by Charles Duhigg”.</em></p><p><em>Any sort of feedback on this piece is greatly appreciated.</em></p><p><em>Hope you enjoyed reading this.</em></p><p><em>Harsh.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d424d073c46e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>