<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=R%2FC2%2FAesthetic-Mapping-in-ggplot2%2FEnglish-timed</id>
		<title>R/C2/Aesthetic-Mapping-in-ggplot2/English-timed - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=R%2FC2%2FAesthetic-Mapping-in-ggplot2%2FEnglish-timed"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=R/C2/Aesthetic-Mapping-in-ggplot2/English-timed&amp;action=history"/>
		<updated>2026-04-23T19:44:30Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=R/C2/Aesthetic-Mapping-in-ggplot2/English-timed&amp;diff=52148&amp;oldid=prev</id>
		<title>Sakinashaikh: Created page with &quot;  {| border =1 |'''Time''' |'''Narration'''  |- || 00:01 || Welcome to this tutorial on '''Aesthetic Mapping in ggplot2'''.   |-  || 00:06 || In this tutorial, we will learn,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=R/C2/Aesthetic-Mapping-in-ggplot2/English-timed&amp;diff=52148&amp;oldid=prev"/>
				<updated>2020-05-22T10:53:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;  {| border =1 |&amp;#039;&amp;#039;&amp;#039;Time&amp;#039;&amp;#039;&amp;#039; |&amp;#039;&amp;#039;&amp;#039;Narration&amp;#039;&amp;#039;&amp;#039;  |- || 00:01 || Welcome to this tutorial on &amp;#039;&amp;#039;&amp;#039;Aesthetic Mapping in ggplot2&amp;#039;&amp;#039;&amp;#039;.   |-  || 00:06 || In this tutorial, we will learn,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{| border =1&lt;br /&gt;
|'''Time'''&lt;br /&gt;
|'''Narration'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| 00:01&lt;br /&gt;
|| Welcome to this tutorial on '''Aesthetic Mapping in ggplot2'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:06&lt;br /&gt;
|| In this tutorial, we will learn,&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:10&lt;br /&gt;
||  What is''' aesthetic'''&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 00:12&lt;br /&gt;
|| How to create plots using '''aesthetic'''&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 00:16&lt;br /&gt;
|| Tuning parameters in '''aesthetic'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:20&lt;br /&gt;
|| To understand this tutorial, you should know, &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:24&lt;br /&gt;
||  Basics of statistics &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 00:27&lt;br /&gt;
|| Basics of '''ggplot2''' package&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 00:30&lt;br /&gt;
|| Data frames&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:33&lt;br /&gt;
||If not, please locate the relevant tutorials on '''R''' on this website.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:40&lt;br /&gt;
|| This tutorial is recorded on&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 00:43&lt;br /&gt;
||'''Ubuntu Linux '''OS version '''16.04'''&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 00:48&lt;br /&gt;
||'''R''' version '''3.4.4'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:52&lt;br /&gt;
|| '''RStudio''' version '''1.1.463'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 00:57&lt;br /&gt;
|| Install '''R''' version '''3.2.0''' or higher. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:03&lt;br /&gt;
|| For this tutorial, we will use&lt;br /&gt;
 &lt;br /&gt;
 |- &lt;br /&gt;
 || 01:06&lt;br /&gt;
 || A '''data frame moviesData.csv''', and &lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 01:10&lt;br /&gt;
||A '''script''' file '''aesPlots.R'''.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:16&lt;br /&gt;
||Please download these files from the '''Code files''' link of this tutorial. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:23&lt;br /&gt;
|| I have downloaded and moved these files to '''aesPlots''' folder. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:30&lt;br /&gt;
||This folder is located in '''myProject''' folder on my '''Desktop'''.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:36&lt;br /&gt;
|| I have set '''aesPlots''' folder as my '''Working Directory.''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:42&lt;br /&gt;
|| Now let us see what is '''Aesthetic'''?&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:46&lt;br /&gt;
|| '''Aesthetic '''is a visual property of the objects in a plot.&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 01:50&lt;br /&gt;
||It includes lines, points, symbols, colors, and position. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 01:57&lt;br /&gt;
|| It is used to add '''customization''' to our plots. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 02:01&lt;br /&gt;
|| Let us switch to '''RStudio'''.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:05&lt;br /&gt;
|| Open the '''script aesPlots.R''' in '''RStudio'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||   02:11&lt;br /&gt;
|| Here, we are plotting a '''scatter plot''' between '''critics_score''' and '''audience_score''' of '''movies'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:19&lt;br /&gt;
|| Run this '''script''' by clicking on the '''Source button'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:24&lt;br /&gt;
|| '''Scatter plot''' appears in the '''Plots''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:28&lt;br /&gt;
|| '''movies data frame''' opens in the '''Source''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:33&lt;br /&gt;
|| In this '''scatter plot''', each point refers to a particular movie. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:39&lt;br /&gt;
|| Suppose we want to color these points according to the '''genre''' of the movies. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:45&lt;br /&gt;
|| In the '''Source''' window, scroll from left to right. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:49&lt;br /&gt;
|| As we can see that there are different '''genres''' like &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:54&lt;br /&gt;
|| '''Drama'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:56&lt;br /&gt;
|| '''Comedy''' &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  02:58&lt;br /&gt;
|| '''Horror'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:00&lt;br /&gt;
|| '''Documentary''', etc. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:03&lt;br /&gt;
||So, we will assign a unique color to each '''genre'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  03:08&lt;br /&gt;
|| Click on the '''script aesPlots.R'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| 03:12&lt;br /&gt;
|| In the '''Source''' window, type the following '''commands'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|| 03:18&lt;br /&gt;
|| Inside '''aes''', we have added '''color argument''' and set it to '''genre'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:26&lt;br /&gt;
|| Save the '''script''' and run the current line by pressing '''Ctrl+ Enter''' keys simultaneously.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:36&lt;br /&gt;
|| Modified''' scatter plot''' appears in the '''Plots''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:41&lt;br /&gt;
|| In the '''Plots''' window, click on the '''Zoom''' button to maximize the plot. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:47&lt;br /&gt;
|| We can see that each point is assigned a unique '''color''' according to its '''genre'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 03:54&lt;br /&gt;
||In the right side of the plot, we can view the mapping of '''genres''' with their colors. &lt;br /&gt;
|- &lt;br /&gt;
|| 04:01&lt;br /&gt;
|| Close this plot. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:03&lt;br /&gt;
|| Now, we will learn how to draw a '''bar chart''' using '''ggplot function'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  04:09&lt;br /&gt;
|| In the '''Source''' window, click on '''movies'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:13&lt;br /&gt;
|| In the '''Source''' window, scroll from left to right. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  04:17&lt;br /&gt;
|| Let us inspect the '''object''' named '''mpaa underscore rating''' in '''movies'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:26&lt;br /&gt;
|| Click on the '''script aesPlots.R'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:31&lt;br /&gt;
|| In the '''Source''' window, type the following '''commands'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:36&lt;br /&gt;
|| Run the last two lines of code. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:40&lt;br /&gt;
|| '''mpaa_rating '''is a '''factor'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:45&lt;br /&gt;
|| It has 6 '''levels''' like &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:47&lt;br /&gt;
|| '''G'''  '''NC-17'''  '''PG'''  '''PG-13'''  '''R''', and  '''Unrated'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 04:55&lt;br /&gt;
|| So, our '''bar chart''' will have 6 different bars. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:00&lt;br /&gt;
||Each bar will represent the number of movies in each '''level'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:06&lt;br /&gt;
|| In the '''Source''' window, type the following '''command'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:11&lt;br /&gt;
|| Here, we have mapped '''mpaa underscore rating''' on X-axis. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:18&lt;br /&gt;
|| Next, we have used '''geom underscore bar''' as we are plotting a '''bar chart'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:25&lt;br /&gt;
||Similarly, we can use &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:27&lt;br /&gt;
|| '''geom_line''' to draw a line chart&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:31&lt;br /&gt;
|| '''geom_boxplot''' to draw a box plot&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:36&lt;br /&gt;
|| Run the current line. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  05:39&lt;br /&gt;
|| The '''bar chart''' appears in the '''Plots''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:43&lt;br /&gt;
|| Now, we will learn how to add labels to this '''bar chart'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:49&lt;br /&gt;
|| In the '''Source''' window, after '''geom_bar(), '''type '''space plus sign''' and press '''Enter'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 05:58&lt;br /&gt;
|| Now type the following '''commands'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:02&lt;br /&gt;
|| Here, we have used '''labs argument''' to add label and title to the bar chart. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:09&lt;br /&gt;
|| Run the current line. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:12&lt;br /&gt;
|| The modified '''bar chart''' appears in the '''Plots''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:17&lt;br /&gt;
|| We can see that most of the movies have been rated as '''R''' in '''mpaa_rating'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:26&lt;br /&gt;
|| Suppose, in this bar chart, we want to view the distribution of movies by '''genre'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:33&lt;br /&gt;
|| In the '''Source''' window, type the following '''command'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:37&lt;br /&gt;
|| Inside '''aes''', we have added '''fill argument''' and set it to '''genre'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:44&lt;br /&gt;
|| Run the current line. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  06:47&lt;br /&gt;
|| The modified '''bar chart''' appears in the '''Plots''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 06:52&lt;br /&gt;
|| In the '''Plots''' window, click on the '''Zoom''' button to maximize the plot. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  06:58&lt;br /&gt;
|| There are seven different colors in each bar. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:03&lt;br /&gt;
||Besides the plot, the meaning of each color has been given.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:09&lt;br /&gt;
|| Close the plot. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:12&lt;br /&gt;
|| In the '''Source''' window, click on '''movies data frame'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:17&lt;br /&gt;
|| Now we will plot a '''histogram '''for the '''object''' named as '''runtime''' in '''movies'''.&lt;br /&gt;
|- &lt;br /&gt;
|| 07:25&lt;br /&gt;
|| Recall that, we have already learned how to plot a histogram using '''hist function'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:32&lt;br /&gt;
|| Now we will use '''ggplot2 package''' to plot a '''histogram'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:38&lt;br /&gt;
|| Click on the '''script aesPlots.R'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:43&lt;br /&gt;
|| In the '''Source''' window, type the following '''command'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:48&lt;br /&gt;
|| Save the '''script''' and run the current line. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:53&lt;br /&gt;
|| There are some warning messages, which we will ignore for now. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 07:58&lt;br /&gt;
|| The histogram appears in the '''Plots''' window. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:02&lt;br /&gt;
|| Let us summarize what we have learnt.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:06&lt;br /&gt;
|| In this tutorial, we have learnt, &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:09&lt;br /&gt;
|| What is '''aesthetic'''&lt;br /&gt;
 &lt;br /&gt;
|- &lt;br /&gt;
|| 08:11&lt;br /&gt;
|| How to create plots using '''aesthetic'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:15&lt;br /&gt;
|| Tuning parameters in '''aesthetic'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:19&lt;br /&gt;
|| We now suggest an assignment.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:22&lt;br /&gt;
|| Using '''built-in data set mtcars''', draw a bar chart from the '''object cyl'''. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:30&lt;br /&gt;
|| Add suitable labels to this bar chart. &lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:34&lt;br /&gt;
|| The video at the following link summarises the Spoken Tutorial project.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:39&lt;br /&gt;
||Please download and watch it.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:42&lt;br /&gt;
|| We conduct workshops using Spoken Tutorials and give certificates.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:47&lt;br /&gt;
||Please contact us.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:49&lt;br /&gt;
|| Please post your timed queries in this forum.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:53&lt;br /&gt;
|| Please post your general queries in this forum.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 08:57&lt;br /&gt;
|| The '''FOSSEE '''team coordinates the '''TBC '''project.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| 09:01&lt;br /&gt;
|| For more details, please visit these sites.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  09:05&lt;br /&gt;
|| The Spoken Tutorial project is funded by  MHRD, Govt. of India&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  09:12&lt;br /&gt;
|| The script for this tutorial was contributed by Varshit Dubey (CoE Pune).&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
||  09:19&lt;br /&gt;
|| This is Sudhakar Kumar from IIT Bombay signing off. Thanks for watching.&lt;/div&gt;</summary>
		<author><name>Sakinashaikh</name></author>	</entry>

	</feed>