<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://eclr.humanities.manchester.ac.uk/index.php?action=history&amp;feed=atom&amp;title=R_AnalysisTidy</id>
		<title>R AnalysisTidy - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://eclr.humanities.manchester.ac.uk/index.php?action=history&amp;feed=atom&amp;title=R_AnalysisTidy"/>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;action=history"/>
		<updated>2026-04-25T20:23:41Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4218&amp;oldid=prev</id>
		<title>Rb: /* Introdution */</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4218&amp;oldid=prev"/>
				<updated>2018-01-09T10:17:46Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Introdution&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:17, 9 January 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Introdution =&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Introdution =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A video walk through this exercise can be found [https://youtu.be/xngavnPBDO4?hd=1 here]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this little project we will demonstrate how to use the mightily powerful packages of the &amp;amp;quot;tidyverse&amp;amp;quot; to perform some data analysis. Some basic data analysis is also described [http://eclr.humanities.manchester.ac.uk/index.php/R_Analysis here] but what the power of the procedures shown here lies in the more advanced data prparation that can be done. In particular we learn how to perform more advanced filtering and grouping tasks such that data analysis can then be applied to a range of different daa slices. Those of you who have some Excel experience may be familiar with pivot tables, and we are aiming to perform tasks that are similar to what pivot tables can do.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this little project we will demonstrate how to use the mightily powerful packages of the &amp;amp;quot;tidyverse&amp;amp;quot; to perform some data analysis. Some basic data analysis is also described [http://eclr.humanities.manchester.ac.uk/index.php/R_Analysis here] but what the power of the procedures shown here lies in the more advanced data prparation that can be done. In particular we learn how to perform more advanced filtering and grouping tasks such that data analysis can then be applied to a range of different daa slices. Those of you who have some Excel experience may be familiar with pivot tables, and we are aiming to perform tasks that are similar to what pivot tables can do.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4216&amp;oldid=prev</id>
		<title>Rb at 23:49, 26 December 2017</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4216&amp;oldid=prev"/>
				<updated>2017-12-26T23:49:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:49, 26 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot; &gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;library(tidyverse)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;library(tidyverse)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By the way, at this stage you should take five minuted to learn about [https://priceonomics.com/hadley-wickham-the-man-who-revolutionized-r/ Hadley Wickham&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;|&lt;/del&gt;] a real hero for data nerds. And if you think at the end of this section &amp;amp;quot;Wow, that is powerful and quite straightforward&amp;amp;quot; you got him to thank for it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By the way, at this stage you should take five minuted to learn about [https://priceonomics.com/hadley-wickham-the-man-who-revolutionized-r/ Hadley Wickham] a real hero for data nerds. And if you think at the end of this section &amp;amp;quot;Wow, that is powerful and quite straightforward&amp;amp;quot; you got him to thank for it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Loading a dataset =&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Loading a dataset =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s get a dataset to look at. We shall use the Baseball wages dataset, including 353 Baseball Players in 1993.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s get a dataset to look at. We shall use the Baseball wages dataset, including 353 Baseball Players in 1993 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(get the datafile from the [http://eclr.humanities.manchester.ac.uk/index.php/R#Data_Sets ECLR page])&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata &amp;amp;lt;- read.csv(&amp;amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;C:/Users/msassrb2/Dropbox (The University of Manchester)/ECLR/R/SummaryStatsTidyverse&lt;/del&gt;/mlb1.csv&amp;amp;quot;)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata &amp;amp;lt;- read.csv(&amp;amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;YOURPATH&lt;/ins&gt;/mlb1.csv&amp;amp;quot;)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s check out what variables we have in this data-file&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s check out what variables we have in this data-file&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l75&quot; &gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So let&amp;#039;s learn by doing.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So let&amp;#039;s learn by doing.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s say we want to see the average salary for each position. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Let&lt;/del&gt;&amp;#039;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;s first &lt;/del&gt;see how we do it and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;then &lt;/del&gt;explain&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s say we want to see the average salary for each position. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;First we&lt;/ins&gt;&amp;#039;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ll &lt;/ins&gt;see how we do it and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;we &lt;/ins&gt;explain &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;what happened afterwards.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot; &gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 5&amp;#160; Short Stop&amp;#160; &amp;#160;  49&amp;#160; 1069210.7&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 5&amp;#160; Short Stop&amp;#160; &amp;#160;  49&amp;#160; 1069210.7&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 6&amp;#160; Third Base&amp;#160; &amp;#160;  34&amp;#160; 1382647.1&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 6&amp;#160; Third Base&amp;#160; &amp;#160;  34&amp;#160; 1382647.1&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here we added another aspect of the above groups. By cchecking &amp;lt;code&amp;gt;length(salary)&amp;lt;/code&amp;gt; we are basically finding out how many group members there are. Here, for instance, we see that there are 52 catchers in the database.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here we added another aspect of the above groups &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to the final display, namely the number of observations&lt;/ins&gt;. By cchecking &amp;lt;code&amp;gt;length(salary)&amp;lt;/code&amp;gt; we are basically finding out how many group members there are. Here, for instance, we see that there are 52 catchers in the database.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also by not just, in &amp;lt;code&amp;gt;summarise, saying&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/del&gt;code&amp;gt;mean(salary)&amp;lt;code&amp;gt;but rather&amp;lt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/del&gt;code&amp;gt;avg.salary = mean(salary)&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;` &lt;/del&gt;we can rename the column in which the salary mean is displayed.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also by not just, in &amp;lt;code&amp;gt;summarise&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;, saying &amp;lt;code&amp;gt;mean(salary)&amp;lt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/ins&gt;code&amp;gt; but rather &amp;lt;code&amp;gt;avg.salary = mean(salary)&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/ins&gt;we can rename the column in which the salary mean is displayed.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Simple pivot tables =&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Simple pivot tables =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l131&quot; &gt;Line 131:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 131:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 1&amp;#160; &amp;#160; &amp;#160; 0&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 289&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1410990&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 1&amp;#160; &amp;#160; &amp;#160; 0&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 289&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1410990&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 2&amp;#160; &amp;#160; &amp;#160; 1&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  64&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1050723&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 2&amp;#160; &amp;#160; &amp;#160; 1&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  64&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1050723&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;reveals that it is hispanics that earned significantly less than the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;otehrs &lt;/del&gt;and the full variety &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;s &lt;/del&gt;only revealed by using our race variable:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;reveals that it is hispanics that earned significantly less than the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;others &lt;/ins&gt;and the full variety &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/ins&gt;only revealed by using our race variable:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(race) %&amp;amp;gt;% summarise(length(salary),mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(race) %&amp;amp;gt;% summarise(length(salary),mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l140&quot; &gt;Line 140:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 140:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 2 Hispanic&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  64&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1050723&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 2 Hispanic&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  64&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1050723&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 3&amp;#160; &amp;#160; White&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 181&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1265780&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 3&amp;#160; &amp;#160; White&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; 181&amp;#160; &amp;#160; &amp;#160; &amp;#160; 1265780&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Without any further analysis one should &lt;/del&gt;not &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;draw any early conclusions from this yet&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;On face value these resuts suggest that, on average, black players earn most and hispanic players the least. Of course there are a numer of other factors at play which this very simple summary statistics does &lt;/ins&gt;not &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;take account of and the three groups very likely differ in other aspects taht are relevant for player salary&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== filter() ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== filter() ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;filter_by&amp;lt;/code&amp;gt; command allows us to remove a subset of the data. Here is how we could use this command if we only wanted to look at players that have not (by 1993) been an all star player.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt;code&amp;gt;filter_by&amp;lt;/code&amp;gt; command allows us to remove a subset of the data. Here is how we could use this command if we only wanted to look at players that have not (by 1993) been an all star player &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&amp;lt;code&amp;gt;yrsallst == 0&amp;lt;/code&amp;gt;)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst == 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst == 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l158&quot; &gt;Line 158:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 158:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When comparing this table to the table above we can of course see that we are now looking at fewer players and their salaries are lower.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When comparing this table to the table above we can of course see that we are now looking at fewer players and their salaries are lower.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We can look at all All Stars by&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We can look at all All Stars &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(&amp;lt;code&amp;gt;yrsallst &amp;amp;gt; 0&amp;lt;/code&amp;gt;) &lt;/ins&gt;by &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;changing the input into the &amp;lt;code&amp;gt;filter&amp;lt;/code&amp;gt; command:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst &amp;amp;gt; 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst &amp;amp;gt; 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l170&quot; &gt;Line 170:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 170:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 5&amp;#160; Short Stop&amp;#160; &amp;#160;  11&amp;#160; &amp;#160; 2387014&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 5&amp;#160; Short Stop&amp;#160; &amp;#160;  11&amp;#160; &amp;#160; 2387014&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 6&amp;#160; Third Base&amp;#160; &amp;#160;  13&amp;#160; &amp;#160; 2482500&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 6&amp;#160; Third Base&amp;#160; &amp;#160;  13&amp;#160; &amp;#160; 2482500&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;immediately seeing that &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;ll &lt;/del&gt;Starts attract significantly higher salaries (note, this is not a causal relationship!). They are All &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Starts &lt;/del&gt;because they are good players and it is being a good player that earns them a high salary.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;immediately seeing that &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;All &lt;/ins&gt;Starts attract significantly higher salaries (note, this is not a causal relationship!). They are All &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Stars &lt;/ins&gt;because they are good players and it is being a good player that earns them a high salary&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Of course there may still be a premium for All Stars, but you cannot conclude this from the above statistics&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== arrange() ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== arrange() ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l189&quot; &gt;Line 189:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 189:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These are tables where we group the data by at least two dimensions, say position and race. So in the end we want a table that has positions in rows, race in columns and the respective group averages in the cells.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;These are tables where we group the data by at least two dimensions, say position and race. So in the end we want a table that has positions in rows, race in columns and the respective group averages in the cells.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== group_by() for more than one group ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l216&quot; &gt;Line 216:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 218:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you can see it is pretty straightforward to group by more than one variable (you merely add another variable to the &amp;lt;code&amp;gt;group_by()&amp;lt;/code&amp;gt; command), but we would like to display the result differently (positions in rows and race in columns).&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you can see it is pretty straightforward to group by more than one variable (you merely add another variable to the &amp;lt;code&amp;gt;group_by()&amp;lt;/code&amp;gt; command), but we would like to display the result differently (positions in rows and race in columns).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This &lt;/del&gt;is achieved &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;by &lt;/del&gt;as follows:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== spread() and arrange() ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;At this stage it is useful to notice that R returned the above tables in what are known as &amp;lt;code&amp;gt;tibbles&amp;lt;/code&amp;gt;, which are a type of dataframe. The above result had three variables: &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;race&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;avg.salary&amp;lt;/code&amp;gt;, the last being the new display variable we created containing the grouped averages.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Rearranging the data display such that variation on one of the grouping variables is shown across different columns &lt;/ins&gt;is achieved as follows:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary)) %&amp;amp;gt;% spread(race,avg.salary)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary)) %&amp;amp;gt;% spread(race,avg.salary)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l230&quot; &gt;Line 230:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 236:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 5&amp;#160; Short Stop 2007098&amp;#160; 682710.5 1103049.6&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 5&amp;#160; Short Stop 2007098&amp;#160; 682710.5 1103049.6&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 6&amp;#160; Third Base 1019889 1309722.3 1540992.4&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 6&amp;#160; Third Base 1019889 1309722.3 1540992.4&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you see we merely added the &amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt; command at the end, meaning that we send the previous result to the &amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt; command. The spread command takes as the first input the variable that should form the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;coluns &lt;/del&gt;and as the second the variable that should show in the cells.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you see we merely added the &amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt; command at the end, meaning that we send the previous result to the &amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt; command. The spread command takes as the first input the variable that should form the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;colums (here &amp;lt;code&amp;gt;race&amp;lt;/code&amp;gt;) &lt;/ins&gt;and as the second &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;input &lt;/ins&gt;the variable that should show in the cells &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(here `avg.salary&amp;#039;)&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To illustrate that you can also group by more than two variables we first create a new variable &amp;lt;code&amp;gt;AS&amp;lt;/code&amp;gt; which is a boolean variable (TRUE or FALSE) depending on whether a player was an all start in 1993. Then we merely add this new variable into our list of group_by variables.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To illustrate that you can also group by more than two variables we first create a new variable &amp;lt;code&amp;gt;AS&amp;lt;/code&amp;gt; which is a boolean variable (TRUE or FALSE) depending on whether a player was an all start in 1993. Then we merely add this new variable into our list of group_by variables.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l253&quot; &gt;Line 253:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 259:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 11&amp;#160; TRUE&amp;#160; Short Stop 4324061.3 1600000.0 1696994.6&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 11&amp;#160; TRUE&amp;#160; Short Stop 4324061.3 1600000.0 1696994.6&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 12&amp;#160; TRUE&amp;#160; Third Base 1953333.3 3016667.0 2599537.0&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;## 12&amp;#160; TRUE&amp;#160; Third Base 1953333.3 3016667.0 2599537.0&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;We smuggled one extra tool into this analysis. The last command here is &amp;lt;code&amp;gt;arrange(AS)&amp;lt;/code&amp;gt;. This merely told R to order the rows in the display table according to the variable &amp;lt;code&amp;gt;AS&amp;lt;/code&amp;gt;. The rows are ordered in ascending order (as &amp;lt;code&amp;gt;AS&amp;lt;/code&amp;gt; is a boolean variable that means from FALSE to TRUE). If you wanted a reversed ordering of &amp;lt;code&amp;gt;AS&amp;lt;/code&amp;gt; and in addition a secondary ordering according to position name you would achieve this by using &amp;lt;code&amp;gt;arrange(desc(AS),position)&amp;lt;/code&amp;gt; instead.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Summary =&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Through this small exercise you got a taste of how to use the mighty piping technique. Once you understand the architecture of the commands you will realise that this is an almighty technique.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Extra Reading =&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I learned this initially from [http://marcoghislanzoni.com/blog/2014/09/01/pivot-tables-r-dplyr/ this website].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4215&amp;oldid=prev</id>
		<title>Rb: /* Introdution */</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4215&amp;oldid=prev"/>
				<updated>2017-12-26T22:50:38Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Introdution&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:50, 26 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Introdution =&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Introdution =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this little project we will demonstrate how to use the mightily powerful packages of the &amp;amp;quot;tidyverse&amp;amp;quot; to perform some data analysis. Some basic data analysis is also described [&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[here|&lt;/del&gt;http://eclr.humanities.manchester.ac.uk/index.php/R_Analysis&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;] but what the power of the procedures shown here lies in the more advanced data prparation that can be done. In particular we learn how to perform more advanced filtering and grouping tasks such that data analysis can then be applied to a range of different daa slices. Those of you who have some Excel experience may be familiar with pivot tables, and we are aiming to perform tasks that are similar to what pivot tables can do.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;In this little project we will demonstrate how to use the mightily powerful packages of the &amp;amp;quot;tidyverse&amp;amp;quot; to perform some data analysis. Some basic data analysis is also described [http://eclr.humanities.manchester.ac.uk/index.php/R_Analysis &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;here&lt;/ins&gt;] but what the power of the procedures shown here lies in the more advanced data prparation that can be done. In particular we learn how to perform more advanced filtering and grouping tasks such that data analysis can then be applied to a range of different daa slices. Those of you who have some Excel experience may be familiar with pivot tables, and we are aiming to perform tasks that are similar to what pivot tables can do.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So before we do anything else you should install the &amp;lt;code&amp;gt;tidyverse&amp;lt;/code&amp;gt; package and then load it:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So before we do anything else you should install the &amp;lt;code&amp;gt;tidyverse&amp;lt;/code&amp;gt; package and then load it:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;library(tidyverse)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;library(tidyverse)&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By the way, at this stage you should take five minuted to learn about [&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[Hadley%20Wickham|&lt;/del&gt;https://priceonomics.com/hadley-wickham-the-man-who-revolutionized-r/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/del&gt;] a real hero for data nerds. And if you think at the end of this section &amp;amp;quot;Wow, that is powerful and quite straightforward&amp;amp;quot; you got him to thank for it.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;By the way, at this stage you should take five minuted to learn about [https://priceonomics.com/hadley-wickham-the-man-who-revolutionized-r/ &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Hadley Wickham|&lt;/ins&gt;] a real hero for data nerds. And if you think at the end of this section &amp;amp;quot;Wow, that is powerful and quite straightforward&amp;amp;quot; you got him to thank for it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Loading a dataset =&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Loading a dataset =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4214&amp;oldid=prev</id>
		<title>Rb at 22:49, 26 December 2017</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4214&amp;oldid=prev"/>
				<updated>2017-12-26T22:49:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:49, 26 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;RalfBecker&amp;lt;br /&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;25 December 2017&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Introdution =&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Introdution =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	<entry>
		<id>http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4213&amp;oldid=prev</id>
		<title>Rb: Created page with &quot;RalfBecker&lt;br /&gt; 25 December 2017  = Introdution =  In this little project we will demonstrate how to use the mightily powerful packages of the &amp;quot;tidyverse&amp;quot; to perfor...&quot;</title>
		<link rel="alternate" type="text/html" href="http://eclr.humanities.manchester.ac.uk/index.php?title=R_AnalysisTidy&amp;diff=4213&amp;oldid=prev"/>
				<updated>2017-12-26T22:47:51Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;RalfBecker&amp;lt;br /&amp;gt; 25 December 2017  = Introdution =  In this little project we will demonstrate how to use the mightily powerful packages of the &amp;quot;tidyverse&amp;quot; to perfor...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;RalfBecker&amp;lt;br /&amp;gt;&lt;br /&gt;
25 December 2017&lt;br /&gt;
&lt;br /&gt;
= Introdution =&lt;br /&gt;
&lt;br /&gt;
In this little project we will demonstrate how to use the mightily powerful packages of the &amp;amp;quot;tidyverse&amp;amp;quot; to perform some data analysis. Some basic data analysis is also described [[here|http://eclr.humanities.manchester.ac.uk/index.php/R_Analysis]] but what the power of the procedures shown here lies in the more advanced data prparation that can be done. In particular we learn how to perform more advanced filtering and grouping tasks such that data analysis can then be applied to a range of different daa slices. Those of you who have some Excel experience may be familiar with pivot tables, and we are aiming to perform tasks that are similar to what pivot tables can do.&lt;br /&gt;
&lt;br /&gt;
So before we do anything else you should install the &amp;lt;code&amp;gt;tidyverse&amp;lt;/code&amp;gt; package and then load it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;library(tidyverse)&amp;lt;/pre&amp;gt;&lt;br /&gt;
By the way, at this stage you should take five minuted to learn about [[Hadley%20Wickham|https://priceonomics.com/hadley-wickham-the-man-who-revolutionized-r/]] a real hero for data nerds. And if you think at the end of this section &amp;amp;quot;Wow, that is powerful and quite straightforward&amp;amp;quot; you got him to thank for it.&lt;br /&gt;
&lt;br /&gt;
= Loading a dataset =&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s get a dataset to look at. We shall use the Baseball wages dataset, including 353 Baseball Players in 1993.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata &amp;amp;lt;- read.csv(&amp;amp;quot;C:/Users/msassrb2/Dropbox (The University of Manchester)/ECLR/R/SummaryStatsTidyverse/mlb1.csv&amp;amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
Let&amp;#039;s check out what variables we have in this data-file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;names(mydata)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;##  [1] &amp;amp;quot;salary&amp;amp;quot;   &amp;amp;quot;teamsal&amp;amp;quot;  &amp;amp;quot;nl&amp;amp;quot;       &amp;amp;quot;years&amp;amp;quot;    &amp;amp;quot;games&amp;amp;quot;    &amp;amp;quot;atbats&amp;amp;quot;  &lt;br /&gt;
##  [7] &amp;amp;quot;runs&amp;amp;quot;     &amp;amp;quot;hits&amp;amp;quot;     &amp;amp;quot;doubles&amp;amp;quot;  &amp;amp;quot;triples&amp;amp;quot;  &amp;amp;quot;hruns&amp;amp;quot;    &amp;amp;quot;rbis&amp;amp;quot;    &lt;br /&gt;
## [13] &amp;amp;quot;bavg&amp;amp;quot;     &amp;amp;quot;bb&amp;amp;quot;       &amp;amp;quot;so&amp;amp;quot;       &amp;amp;quot;sbases&amp;amp;quot;   &amp;amp;quot;fldperc&amp;amp;quot;  &amp;amp;quot;frstbase&amp;amp;quot;&lt;br /&gt;
## [19] &amp;amp;quot;scndbase&amp;amp;quot; &amp;amp;quot;shrtstop&amp;amp;quot; &amp;amp;quot;thrdbase&amp;amp;quot; &amp;amp;quot;outfield&amp;amp;quot; &amp;amp;quot;catcher&amp;amp;quot;  &amp;amp;quot;yrsallst&amp;amp;quot;&lt;br /&gt;
## [25] &amp;amp;quot;hispan&amp;amp;quot;   &amp;amp;quot;black&amp;amp;quot;    &amp;amp;quot;whitepop&amp;amp;quot; &amp;amp;quot;blackpop&amp;amp;quot; &amp;amp;quot;hisppop&amp;amp;quot;  &amp;amp;quot;pcinc&amp;amp;quot;   &lt;br /&gt;
## [31] &amp;amp;quot;gamesyr&amp;amp;quot;  &amp;amp;quot;hrunsyr&amp;amp;quot;  &amp;amp;quot;atbatsyr&amp;amp;quot; &amp;amp;quot;allstar&amp;amp;quot;  &amp;amp;quot;slugavg&amp;amp;quot;  &amp;amp;quot;rbisyr&amp;amp;quot;  &lt;br /&gt;
## [37] &amp;amp;quot;sbasesyr&amp;amp;quot; &amp;amp;quot;runsyr&amp;amp;quot;   &amp;amp;quot;percwhte&amp;amp;quot; &amp;amp;quot;percblck&amp;amp;quot; &amp;amp;quot;perchisp&amp;amp;quot; &amp;amp;quot;blckpb&amp;amp;quot;  &lt;br /&gt;
## [43] &amp;amp;quot;hispph&amp;amp;quot;   &amp;amp;quot;whtepw&amp;amp;quot;   &amp;amp;quot;blckph&amp;amp;quot;   &amp;amp;quot;hisppb&amp;amp;quot;   &amp;amp;quot;lsalary&amp;amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can find short variable descriptions [http://eclr.humanities.manchester.ac.uk/index.php/MLB1_Variable_Description here] and of course you need to understand what data types the variables represent (check &amp;lt;code&amp;gt;str(mydata)&amp;lt;/code&amp;gt; to confirm the R datatypes.)&lt;br /&gt;
&lt;br /&gt;
You can perhaps see that the positional information is organised in individual positional variables (&amp;amp;quot;frstbase&amp;amp;quot; &amp;amp;quot;scndbase&amp;amp;quot; &amp;amp;quot;shrtstop&amp;amp;quot; &amp;amp;quot;thrdbase&amp;amp;quot; &amp;amp;quot;outfield&amp;amp;quot; &amp;amp;quot;catcher&amp;amp;quot;) that take the value 1 if a player plays in a particular position.&lt;br /&gt;
&lt;br /&gt;
To confirm that each player is only assigned one position we calculate the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;temp &amp;amp;lt;- rowSums(mydata[,c(&amp;amp;quot;frstbase&amp;amp;quot;,&amp;amp;quot;scndbase&amp;amp;quot;,&amp;amp;quot;shrtstop&amp;amp;quot;,&amp;amp;quot;thrdbase&amp;amp;quot;,&amp;amp;quot;outfield&amp;amp;quot;,&amp;amp;quot;catcher&amp;amp;quot;)])&lt;br /&gt;
min(temp)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## [1] 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;max(temp)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## [1] 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
As the result is one for both min and max value we have confirmed that every player has been assigned exactly one position.&lt;br /&gt;
&lt;br /&gt;
A similar situation exists with teh ethnicity variable. We have two variables (&amp;amp;quot;hispan&amp;amp;quot; &amp;amp;quot;black&amp;amp;quot;) which are 1 if the respective player is ither black or hispanic. If both are 0 the player is white.&lt;br /&gt;
&lt;br /&gt;
Let us now create two variables (&amp;amp;quot;position&amp;amp;quot; and &amp;amp;quot;race&amp;amp;quot;) which summarise the respective information in one variable each.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata$position &amp;amp;lt;- &amp;amp;quot;First Base&amp;amp;quot;&lt;br /&gt;
mydata$position[mydata$scndbase == 1] &amp;amp;lt;- &amp;amp;quot;Second Base&amp;amp;quot;&lt;br /&gt;
mydata$position[mydata$shrtstop == 1] &amp;amp;lt;- &amp;amp;quot;Short Stop&amp;amp;quot;&lt;br /&gt;
mydata$position[mydata$thrdbase == 1] &amp;amp;lt;- &amp;amp;quot;Third Base&amp;amp;quot;&lt;br /&gt;
mydata$position[mydata$outfield == 1] &amp;amp;lt;- &amp;amp;quot;Outfield&amp;amp;quot;&lt;br /&gt;
mydata$position[mydata$catcher == 1] &amp;amp;lt;- &amp;amp;quot;Catcher&amp;amp;quot;&lt;br /&gt;
mydata$position &amp;amp;lt;- as.factor(mydata$position)  # now ensure it is a factor variable&lt;br /&gt;
&lt;br /&gt;
mydata$race &amp;amp;lt;- &amp;amp;quot;White&amp;amp;quot;&lt;br /&gt;
mydata$race[mydata$hispan == 1] &amp;amp;lt;- &amp;amp;quot;Hispanic&amp;amp;quot;&lt;br /&gt;
mydata$race[mydata$black == 1] &amp;amp;lt;- &amp;amp;quot;Black&amp;amp;quot;&lt;br /&gt;
mydata$race &amp;amp;lt;- as.factor(mydata$race)   # now ensure it is a factor variable&amp;lt;/pre&amp;gt;&lt;br /&gt;
= What data dimensions are you interested in? =&lt;br /&gt;
&lt;br /&gt;
Almost the most difficult task in data analysis, in particular if you have data with so many different variables as the dataset here, is to know what you are interested in. Once you know that you have to find ways to slice the data into the right bits before you analyse them. That is the main task to learn here.&lt;br /&gt;
&lt;br /&gt;
== A flashback ==&lt;br /&gt;
&lt;br /&gt;
Remember a few basis commands before we proceed. If you want a quick summaries for a particular variable in the data frame, say &amp;lt;code&amp;gt;salary&amp;lt;/code&amp;gt; you use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;summary(mydata$salary)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. &lt;br /&gt;
##  109000  253600  675000 1346000 2250000 6329000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;summary(mydata$position)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;##     Catcher  First Base    Outfield Second Base  Short Stop  Third Base &lt;br /&gt;
##          52          45         136          37          49          34&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you know exectly the particular statistic you are afte, you can immediately calculate it as such&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;max(mydata$salary)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## [1] 6329213&amp;lt;/pre&amp;gt;&lt;br /&gt;
== First pipe! ==&lt;br /&gt;
&lt;br /&gt;
So let&amp;#039;s learn by doing.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s say we want to see the average salary for each position. Let&amp;#039;s first see how we do it and then explain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 6 × 2&lt;br /&gt;
##      position `mean(salary)`&lt;br /&gt;
##        &amp;amp;lt;fctr&amp;amp;gt;          &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     Catcher       892519.2&lt;br /&gt;
## 2  First Base      1586781.5&lt;br /&gt;
## 3    Outfield      1539324.3&lt;br /&gt;
## 4 Second Base      1309640.9&lt;br /&gt;
## 5  Short Stop      1069210.7&lt;br /&gt;
## 6  Third Base      1382647.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we used the &amp;lt;code&amp;gt;%&amp;amp;gt;%&amp;lt;/code&amp;gt; piping operator. What this does is best described in words. Here we did the following: &amp;amp;quot;Thake the dataset mydata, group the data by position and then summarise the data by presenting the mean salary for each group&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s show a few variations here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 6 × 3&lt;br /&gt;
##      position number avg.salary&lt;br /&gt;
##        &amp;amp;lt;fctr&amp;amp;gt;  &amp;amp;lt;int&amp;amp;gt;      &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     Catcher     52   892519.2&lt;br /&gt;
## 2  First Base     45  1586781.5&lt;br /&gt;
## 3    Outfield    136  1539324.3&lt;br /&gt;
## 4 Second Base     37  1309640.9&lt;br /&gt;
## 5  Short Stop     49  1069210.7&lt;br /&gt;
## 6  Third Base     34  1382647.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we added another aspect of the above groups. By cchecking &amp;lt;code&amp;gt;length(salary)&amp;lt;/code&amp;gt; we are basically finding out how many group members there are. Here, for instance, we see that there are 52 catchers in the database.&lt;br /&gt;
&lt;br /&gt;
Also by not just, in &amp;lt;code&amp;gt;summarise, saying&amp;lt;/code&amp;gt;mean(salary)&amp;lt;code&amp;gt;but rather&amp;lt;/code&amp;gt;avg.salary = mean(salary)` we can rename the column in which the salary mean is displayed.&lt;br /&gt;
&lt;br /&gt;
= Simple pivot tables =&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s start with what I call simple pivot tables. Tables where we group by one variable.&lt;br /&gt;
&lt;br /&gt;
== The core tools ==&lt;br /&gt;
&lt;br /&gt;
Now we look at each of the main tools in our toolbox&lt;br /&gt;
&lt;br /&gt;
=== group_by ===&lt;br /&gt;
&lt;br /&gt;
The main work in the example above was done by the &amp;lt;code&amp;gt;group_by&amp;lt;/code&amp;gt; command. The variables by which we group will typically be categorical variables. Often these will be defined as factor variables. But they could also be, for instance, &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; variables, such as &amp;lt;code&amp;gt;black&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(black) %&amp;amp;gt;% summarise(length(salary),mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 2 × 3&lt;br /&gt;
##   black `length(salary)` `mean(salary)`&lt;br /&gt;
##   &amp;amp;lt;int&amp;amp;gt;            &amp;amp;lt;int&amp;amp;gt;          &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     0              245        1209602&lt;br /&gt;
## 2     1              108        1654350&amp;lt;/pre&amp;gt;&lt;br /&gt;
Interestingly this would suggest that black players earn higher salaries. However,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(hispan) %&amp;amp;gt;% summarise(length(salary),mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 2 × 3&lt;br /&gt;
##   hispan `length(salary)` `mean(salary)`&lt;br /&gt;
##    &amp;amp;lt;int&amp;amp;gt;            &amp;amp;lt;int&amp;amp;gt;          &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1      0              289        1410990&lt;br /&gt;
## 2      1               64        1050723&amp;lt;/pre&amp;gt;&lt;br /&gt;
reveals that it is hispanics that earned significantly less than the otehrs and the full variety s only revealed by using our race variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(race) %&amp;amp;gt;% summarise(length(salary),mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 3 × 3&lt;br /&gt;
##       race `length(salary)` `mean(salary)`&lt;br /&gt;
##     &amp;amp;lt;fctr&amp;amp;gt;            &amp;amp;lt;int&amp;amp;gt;          &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1    Black              108        1654350&lt;br /&gt;
## 2 Hispanic               64        1050723&lt;br /&gt;
## 3    White              181        1265780&amp;lt;/pre&amp;gt;&lt;br /&gt;
Without any further analysis one should not draw any early conclusions from this yet.&lt;br /&gt;
&lt;br /&gt;
=== filter() ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filter_by&amp;lt;/code&amp;gt; command allows us to remove a subset of the data. Here is how we could use this command if we only wanted to look at players that have not (by 1993) been an all star player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst == 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 6 × 3&lt;br /&gt;
##      position number avg.salary&lt;br /&gt;
##        &amp;amp;lt;fctr&amp;amp;gt;  &amp;amp;lt;int&amp;amp;gt;      &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     Catcher     42   587166.7&lt;br /&gt;
## 2  First Base     31   827747.3&lt;br /&gt;
## 3    Outfield     93   858689.3&lt;br /&gt;
## 4 Second Base     25   717133.3&lt;br /&gt;
## 5  Short Stop     38   687741.2&lt;br /&gt;
## 6  Third Base     21   701785.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
When comparing this table to the table above we can of course see that we are now looking at fewer players and their salaries are lower.&lt;br /&gt;
&lt;br /&gt;
We can look at all All Stars by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst &amp;amp;gt; 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 6 × 3&lt;br /&gt;
##      position number avg.salary&lt;br /&gt;
##        &amp;amp;lt;fctr&amp;amp;gt;  &amp;amp;lt;int&amp;amp;gt;      &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     Catcher     10    2175000&lt;br /&gt;
## 2  First Base     14    3267500&lt;br /&gt;
## 3    Outfield     43    3011395&lt;br /&gt;
## 4 Second Base     12    2544032&lt;br /&gt;
## 5  Short Stop     11    2387014&lt;br /&gt;
## 6  Third Base     13    2482500&amp;lt;/pre&amp;gt;&lt;br /&gt;
immediately seeing that ll Starts attract significantly higher salaries (note, this is not a causal relationship!). They are All Starts because they are good players and it is being a good player that earns them a high salary.&lt;br /&gt;
&lt;br /&gt;
=== arrange() ===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s say you wanted to arrange the table such that positions with lower salaries are shown first. The &amp;lt;code&amp;gt;arrange&amp;lt;/code&amp;gt; command is the tool you need.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% filter(yrsallst == 0) %&amp;amp;gt;% group_by(position) %&amp;amp;gt;% summarise(number = length(salary),avg.salary = mean(salary)) %&amp;amp;gt;% arrange(avg.salary)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## # A tibble: 6 × 3&lt;br /&gt;
##      position number avg.salary&lt;br /&gt;
##        &amp;amp;lt;fctr&amp;amp;gt;  &amp;amp;lt;int&amp;amp;gt;      &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     Catcher     42   587166.7&lt;br /&gt;
## 2  Short Stop     38   687741.2&lt;br /&gt;
## 3  Third Base     21   701785.7&lt;br /&gt;
## 4 Second Base     25   717133.3&lt;br /&gt;
## 5  First Base     31   827747.3&lt;br /&gt;
## 6    Outfield     93   858689.3&amp;lt;/pre&amp;gt;&lt;br /&gt;
= Double pivot tables =&lt;br /&gt;
&lt;br /&gt;
These are tables where we group the data by at least two dimensions, say position and race. So in the end we want a table that has positions in rows, race in columns and the respective group averages in the cells.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## Source: local data frame [18 x 3]&lt;br /&gt;
## Groups: position [?]&lt;br /&gt;
## &lt;br /&gt;
##       position     race avg.salary&lt;br /&gt;
##         &amp;amp;lt;fctr&amp;amp;gt;   &amp;amp;lt;fctr&amp;amp;gt;      &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1      Catcher    Black   736000.0&lt;br /&gt;
## 2      Catcher Hispanic   970214.3&lt;br /&gt;
## 3      Catcher    White   887151.2&lt;br /&gt;
## 4   First Base    Black  1582916.7&lt;br /&gt;
## 5   First Base Hispanic   977833.3&lt;br /&gt;
## 6   First Base    White  1799057.7&lt;br /&gt;
## 7     Outfield    Black  1728032.4&lt;br /&gt;
## 8     Outfield Hispanic  1344531.6&lt;br /&gt;
## 9     Outfield    White  1319637.0&lt;br /&gt;
## 10 Second Base    Black  1715208.2&lt;br /&gt;
## 11 Second Base Hispanic  1315357.1&lt;br /&gt;
## 12 Second Base    White  1160343.0&lt;br /&gt;
## 13  Short Stop    Black  2007097.7&lt;br /&gt;
## 14  Short Stop Hispanic   682710.5&lt;br /&gt;
## 15  Short Stop    White  1103049.6&lt;br /&gt;
## 16  Third Base    Black  1019888.9&lt;br /&gt;
## 17  Third Base Hispanic  1309722.3&lt;br /&gt;
## 18  Third Base    White  1540992.4&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you can see it is pretty straightforward to group by more than one variable (you merely add another variable to the &amp;lt;code&amp;gt;group_by()&amp;lt;/code&amp;gt; command), but we would like to display the result differently (positions in rows and race in columns).&lt;br /&gt;
&lt;br /&gt;
This is achieved by as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata %&amp;amp;gt;% group_by(position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary)) %&amp;amp;gt;% spread(race,avg.salary)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## Source: local data frame [6 x 4]&lt;br /&gt;
## Groups: position [6]&lt;br /&gt;
## &lt;br /&gt;
##      position   Black  Hispanic     White&lt;br /&gt;
## *      &amp;amp;lt;fctr&amp;amp;gt;   &amp;amp;lt;dbl&amp;amp;gt;     &amp;amp;lt;dbl&amp;amp;gt;     &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1     Catcher  736000  970214.3  887151.2&lt;br /&gt;
## 2  First Base 1582917  977833.3 1799057.7&lt;br /&gt;
## 3    Outfield 1728032 1344531.6 1319637.0&lt;br /&gt;
## 4 Second Base 1715208 1315357.1 1160343.0&lt;br /&gt;
## 5  Short Stop 2007098  682710.5 1103049.6&lt;br /&gt;
## 6  Third Base 1019889 1309722.3 1540992.4&amp;lt;/pre&amp;gt;&lt;br /&gt;
As you see we merely added the &amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt; command at the end, meaning that we send the previous result to the &amp;lt;code&amp;gt;spread&amp;lt;/code&amp;gt; command. The spread command takes as the first input the variable that should form the coluns and as the second the variable that should show in the cells.&lt;br /&gt;
&lt;br /&gt;
To illustrate that you can also group by more than two variables we first create a new variable &amp;lt;code&amp;gt;AS&amp;lt;/code&amp;gt; which is a boolean variable (TRUE or FALSE) depending on whether a player was an all start in 1993. Then we merely add this new variable into our list of group_by variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;r&amp;quot;&amp;gt;mydata$AS &amp;amp;lt;- (mydata$yrsallst&amp;amp;gt;0)&lt;br /&gt;
mydata %&amp;amp;gt;% group_by(AS,position,race) %&amp;amp;gt;% summarise(avg.salary = mean(salary)) %&amp;amp;gt;% spread(race,avg.salary) %&amp;amp;gt;% arrange(AS)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;## Source: local data frame [12 x 5]&lt;br /&gt;
## Groups: AS, position [12]&lt;br /&gt;
## &lt;br /&gt;
##       AS    position     Black  Hispanic     White&lt;br /&gt;
##    &amp;amp;lt;lgl&amp;amp;gt;      &amp;amp;lt;fctr&amp;amp;gt;     &amp;amp;lt;dbl&amp;amp;gt;     &amp;amp;lt;dbl&amp;amp;gt;     &amp;amp;lt;dbl&amp;amp;gt;&lt;br /&gt;
## 1  FALSE     Catcher  172000.0  238300.0  647152.8&lt;br /&gt;
## 2  FALSE  First Base  625694.5  521500.0 1014194.4&lt;br /&gt;
## 3  FALSE    Outfield  831628.8  762221.4  931295.3&lt;br /&gt;
## 4  FALSE Second Base  708750.0 1014000.0  626458.3&lt;br /&gt;
## 5  FALSE  Short Stop  269375.0  510718.8  938064.8&lt;br /&gt;
## 6  FALSE  Third Base  553166.7  456250.0  808153.8&lt;br /&gt;
## 7   TRUE     Catcher 1300000.0 2800000.0 2121428.6&lt;br /&gt;
## 8   TRUE  First Base 3018750.0 2575000.0 3565000.0&lt;br /&gt;
## 9   TRUE    Outfield 3136666.6 2975000.0 2678833.3&lt;br /&gt;
## 10  TRUE Second Base 2721666.5 2068750.0 2584035.5&lt;br /&gt;
## 11  TRUE  Short Stop 4324061.3 1600000.0 1696994.6&lt;br /&gt;
## 12  TRUE  Third Base 1953333.3 3016667.0 2599537.0&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rb</name></author>	</entry>

	</feed>