<!--WPFC_PAGE_TYPE_category--><?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>R language - Master Data Analysis</title>
	<atom:link href="https://www.masterdataanalysis.com/category/r/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.masterdataanalysis.com/category/r/</link>
	<description></description>
	<lastBuildDate>Wed, 24 Jul 2019 00:55:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.masterdataanalysis.com/wp-content/uploads/2024/03/cropped-faviconArtboard-19-32x32.png</url>
	<title>R language - Master Data Analysis</title>
	<link>https://www.masterdataanalysis.com/category/r/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>18 courses to learn R in 2018</title>
		<link>https://www.masterdataanalysis.com/r/18-courses-learn-r-2018/</link>
					<comments>https://www.masterdataanalysis.com/r/18-courses-learn-r-2018/#comments</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Mon, 01 Jan 2018 22:33:25 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<guid isPermaLink="false">https://www.masterdataanalysis.com/?p=2138</guid>

					<description><![CDATA[<p>Do you want to learn or get better at R programming?  If yes, you will love the list below. I have compiled a list of free and paid R programming courses. Most of them are online and free, so NO excuses about location or money to uplift your skills. The list includes courses for ALL [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/18-courses-learn-r-2018/">18 courses to learn R in 2018</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Do you want to learn or get better at R programming?</p>
<p> If yes, you will love the list below. I have compiled a list of free and paid R programming courses. Most of them are online and free, so NO excuses about location or money to uplift your skills.</p>
<p>The list includes courses for ALL levels from beginners to advanced users.</p>
<p>The link in the <em>Description</em> column will take you to a general description of the course and the link in the <em>Link to course</em> column will take you to the course website.</p>
<h2><a id="Courses_Table"></a>Courses Table</h2>
<table style="border-color: #050505; width: 771px; height: 776px; text-align: center;">
<tbody>
<tr>
<td style="width: 171px;"><strong>Name of Course</strong></td>
<td style="width: 83px;"><strong>Cost</strong></td>
<td style="width: 170px;"><strong>Company/University</strong></td>
<td style="width: 126px;"><strong>Start Date</strong></td>
<td style="width: 97px;"><strong>Description</strong></td>
<td style="width: 178px;"><strong>Link to course</strong></td>
</tr>
<tr>
<td style="width: 171px;">The Analytics Edge</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">MIT (EdX)</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"> <a href="#Course1">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/analytics-edge-mitx-15-071x-2"> Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Analyzing Big Data with Microsoft R Server</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Microsoft (EdX)</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course2">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/analyzing-big-data-microsoft-r-server-microsoft-dat213x" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">R Programming</td>
<td style="width: 83px;">Free/$49</td>
<td style="width: 170px;">Johns Hopkins<br />
University</td>
<td style="width: 126px;">05-Feb-2018</td>
<td style="width: 97px;"><a href="#Course3">Link</a></td>
<td style="width: 178px;"><a href="https://www.coursera.org/learn/r-programming">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Introduction to<br />
R Programming</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Microsoft (EdX)</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course4">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/introduction-r-programming-microsoft-dat204x-0" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Google Developers<br />
R Programming</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Google Developers</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course5">Link</a></td>
<td style="width: 178px;"><a href="https://www.youtube.com/watch?v=iffR3fWv4xw&amp;list=PLOU2XLYxmsIK9qQfztXeybpHvru-TrqAP">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Data Analysis<br />
with R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Udacity</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course6">Link</a></td>
<td style="width: 178px;"><a href="https://www.udacity.com/course/data-analysis-with-r--ud651">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Analyzing Big Data in R using Apache Spark</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Cognitive Class</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course7">Link</a></td>
<td style="width: 178px;"><a href="https://bigdatauniversity.com/courses/analyzing-big-data-r-using-apache-spark/" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Introduction to R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">DataCamp</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course8">Link</a></td>
<td style="width: 178px;"><a href="https://www.datacamp.com/courses/free-introduction-to-r" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Statistical Computing<br />
with R Programming<br />
Language</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">University College London</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course9">Link</a></td>
<td style="width: 178px;"><a href="https://www.ucl.ac.uk/lifelearning/courses/statistical-computing-r-programming-introduction">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Forecasting using R</td>
<td style="width: 83px;">$29/month</td>
<td style="width: 170px;">Data Camp</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course10">Link</a></td>
<td style="width: 178px;"><a href="https://www.datacamp.com/courses/forecasting-using-r" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">R Basics – R<br />
Programming Language<br />
Introduction</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Udemy</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course11">Link</a></td>
<td style="width: 178px;"><a href="https://www.udemy.com/r-basics/" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Writing Functions in R</td>
<td style="width: 83px;">$29/month</td>
<td style="width: 170px;">Data Camp</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course12">Link</a></td>
<td style="width: 178px;"><a href="https://www.datacamp.com/courses/writing-functions-in-r" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Advanced R Programming</td>
<td style="width: 83px;">$49</td>
<td style="width: 170px;">John Hopkins (Coursera)</td>
<td style="width: 126px;">05-Feb-2018</td>
<td style="width: 97px;"><a href="#Course13">Link</a></td>
<td style="width: 178px;"><a href="https://www.coursera.org/learn/advanced-r">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Statistics Using R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">UTAustinX</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course14">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/foundations-data-analysis-part-1-utaustinx-ut-7-10x#.VGdFKmf4bIU">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Try R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Codeschool</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course15">Link</a></td>
<td style="width: 178px;"><a href="https://www.codeschool.com/courses/try-r">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Building R Packages</td>
<td style="width: 83px;">$49</td>
<td style="width: 170px;">John Hopkins (Coursera)</td>
<td style="width: 126px;">05-Feb-2018</td>
<td style="width: 97px;"><a href="#Course16">Link</a></td>
<td style="width: 178px;"><a href="https://www.coursera.org/learn/r-packages">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">R 101</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Cognitive Class</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"> <a href="#Course17">Link</a></td>
<td style="width: 178px;"><a href="https://cognitiveclass.ai/courses/r-101/">Link</a></td>
</tr>
</tbody>
</table>
<p><style>
  .bordered {<br />
    width: 600px;<br />
    height: 125px;<br />
    padding: 20px;<br />
    border: 3px dashed #4CAF50;<br />
    border-radius: 8px;<br />
  }<br />
</style>
</p>
<div class="bordered">
<p><strong>Are you getting started with R? If yes, make sure to subscribe to the blog.</strong> During this year, I&#8217;ll be posting approximately every two weeks with tips for people getting started in data analysis with R.</p>
</div>
</p>
<h2>Courses Descriptions</h2>
<h3><a id="Course1"></a>The Analytics Edge</h3>
<p>What you&#8217;ll learn: An applied understanding of many different analytics methods, including linear regression, logistic regression, CART, clustering, and data visualization.<br />
How to implement all of these methods in R.<br />
An applied understanding of mathematical optimization and how to solve optimization models in spreadsheet software.</p>
<p><a href="https://www.edx.org/course/analytics-edge-mitx-15-071x-2" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course2"></a>Analyzing Big Data with Microsoft R Server</h3>
<p>Learn how to use Microsoft R Server to analyze large datasets using R.</p>
<p>The main component of Microsoft R Server (MRS) is the RevoScaleR package, which is an R library that offers a set of functionalities for processing large datasets without having to load them all at once in the memory. RevoScaleR offers a rich set of distributed statistical and machine learning algorithms, which get added to over time. Finally, RevoScaleR also offers a mechanism by which we can take code that we developed on our laptop and deploy it on a remote server such as SQL Server or Spark (where the infrastructure is very different under the hood), with minimal effort.</p>
<p><a href="https://www.edx.org/course/analyzing-big-data-microsoft-r-server-microsoft-dat213x" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course3"></a>R Programming</h3>
<p>In this course you will learn how to program in R and how to use R for effective data analysis. You will learn how to install and configure software necessary for a statistical programming environment and describe generic programming language concepts as they are implemented in a high-level statistical language.</p>
<p>The course covers practical issues in statistical computing which includes programming in R, reading data into R, accessing R packages, writing R functions, debugging, profiling R code, and organizing and commenting R code. Topics in statistical data analysis will provide working examples.</p>
<p><a href="https://www.coursera.org/learn/r-programming" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course4"></a>Introduction to R Programming</h3>
<p>“This introduction to R programming course will help you master the basics of R. In seven sections, you will cover its basic syntax, making you ready to undertake your own first data analysis using R.</p>
<p>Starting from variables and basic operations, you will learn how to handle data structures such as vectors, matrices, data frames and lists. In the final section, you will dive deeper into the graphical capabilities of R, and create your own stunning data visualizations. No prior knowledge in programming or data science is required.</p>
<p>What makes this R programming course unique is that you will continuously practice your newly acquired skills through interactive in-browser coding challenges using the DataCamp platform.</p>
<p>Instead of passively watching videos, you will solve real data problems while receiving instant and personalized feedback that guides you to the correct solution.”</p>
<p><a href="https://www.edx.org/course/introduction-r-programming-microsoft-dat204x-0" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course5"></a>Google Developers R Programming</h3>
<p>Short videos about R programming from Google Developers</p>
<p><a href="https://www.youtube.com/watch?v=iffR3fWv4xw&amp;list=PLOU2XLYxmsIK9qQfztXeybpHvru-TrqAP" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course6"></a>Data Analysis with R</h3>
<p>Exploratory data analysis is an approach for summarizing and visualizing the important characteristics of a data set. Promoted by John Tukey, exploratory data analysis focuses on exploring data to understand the data’s underlying structure and variables, to develop intuition about the data set, to consider how that data set came into existence, and to decide how it can be investigated with more formal statistical methods.</p>
<p><a href="https://www.udacity.com/course/data-analysis-with-r--ud651" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course7"></a>Analyzing Big Data in R using Apache Spark</h3>
<p>Master Apache Spark, a popular cluster computing framework used for performing large scale data analysis. SparkR provides a distributed data frame API that enables structured data processing with a syntax familiar to R users.</p>
<p>Learn why R is a popular statistical programming language with a number of extensions that support data processing and machine learning tasks.<br />
Learn how SparkR, an R package that provides a light-weight frontend, uses Apache Spark from R.</p>
<p><a href="https://bigdatauniversity.com/courses/analyzing-big-data-r-using-apache-spark/" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course8"></a>Introduction to R</h3>
<p>With over 2 million users worldwide R is rapidly becoming the leading programming language in statistics and data science. Every year, the number of R users grows by 40%, and an increasing number of organizations are using it in their day-to-day activities.</p>
<p>In this introduction to R, you will master the basics of this beautiful open source language such as factors, lists and data frames. With the knowledge gained in this course, you will be ready to undertake your first very own data analysis.</p>
<p><a href="https://www.datacamp.com/courses/free-introduction-to-r" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course9"></a>Statistical Computing with R Programming Language</h3>
<p>“This short course is for anyone who wants to learn the basics of R, and computer programming in general, although the tasks focus on examples from the biosciences. It’s suitable for undergraduates, graduates and researchers from any field that uses statistical computing.”</p>
<p><a href="https://www.ucl.ac.uk/lifelearning/courses/statistical-computing-r-programming-introduction" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course10"></a>Forecasting using R</h3>
<p class="course__description">Forecasting involves making predictions about the future. It is required in many situations: deciding whether to build another power generation plant in the next ten years requires forecasts of future demand; scheduling staff in a call centre next week requires forecasts of call volumes; stocking an inventory requires forecasts of stock requirements. Forecasts can be required several years in advance (for the case of capital investments), or only a few minutes beforehand (for telecommunication routing). Whatever the circumstances or time horizons involved, forecasting is an important aid to effective and efficient planning. This course provides an introduction to time series forecasting using R.</p>
<p><a href="https://www.datacamp.com/courses/forecasting-using-r" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course11"></a>R Basics – R Programming Language Introduction</h3>
<p>“This course was created by R Tutorials. It is meant to give you an introductory understanding of the R language. It takes about 2 hr (+ the time you need to solve the exercises) to complete this course. This is just enough time for a brief introduction.</p>
<p>R programming becomes more and more popular since it is fully open source and reacts very dynamic to new developments.Nowadays it is vital in many scientific or other analytical fields to have a good understanding of the R language. With this course you can build a very solid foundation to later on branch out to the various applications R has to offer.</p>
<p>You will learn about basic commands like “”paste””, “”seq””, “”rep”” and you will also see how graphs are created in R.</p>
<p>We use RStudio as our user interface. You will quickly see that this software makes using R much easier. This course is totally free to you – it is the perfect chance to get familiar with R programming.”</p>
<p><a href="https://www.udemy.com/r-basics/" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course12"></a>Writing Functions in R</h3>
<p>This course taught by Hadley and Charlotte Wickham will teach you the fundamentals of writing functions in R so that, among other things, you can make your code more readable, avoid coding errors, and automate repetitive tasks.</p>
<p>The course go into functional programming using the purrr package, handling complicated inputs and creating robust functions.</p>
<p><a href="https://www.datacamp.com/courses/writing-functions-in-r" target="_blank" rel="noopener noreferrer" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course13"></a>Advanced R Programming</h3>
</p>
<p>This course covers advanced topics in R programming that are necessary for developing powerful, robust, and reusable data science tools. Topics covered include functional programming in R, robust error handling, object oriented programming, profiling and benchmarking, debugging, and proper design of functions. Upon completing this course you will be able to identify and abstract common data analysis tasks and to encapsulate them in user-facing functions. Because every data science environment encounters unique data challenges, there is always a need to develop custom software specific to your organization’s mission. You will also be able to define new data types in R and to develop a universe of functionality specific to those data types to enable cleaner execution of data science tasks and stronger reusability within a team.</p>
<p><a href="https://www.coursera.org/learn/advanced-r" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course14"></a>Statistics Using R</h3>
<p>In this first part of a two part course, we’ll walk through the basics of statistical thinking – starting with an interesting question. Then, we’ll learn the correct statistical tool to help answer our question of interest – using R and hands-on Labs.</p>
<p>Finally, we’ll learn how to interpret our findings and develop a meaningful conclusion</p>
<p><a href="https://www.edx.org/course/foundations-data-analysis-part-1-utaustinx-ut-7-10x#.VGdFKmf4bIU" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course15"></a>Try R</h3>
<p>Learn the R programming language for data analysis and visualization.</p>
<p>This software programming language is great for statistical computing and graphics.</p>
<p><a href="https://www.codeschool.com/courses/try-r" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course16"></a>Building R Packages</h3>
</p>
<p>Writing good code for data science is only part of the job. In order to maximizing the usefulness and reusability of data science software, code must be organized and distributed in a manner that adheres to community-based standards and provides a good user experience. This course covers the primary means by which R software is organized and distributed to others. We cover R package development, writing good documentation and vignettes, writing robust software, cross-platform development, continuous integration tools, and distributing packages via CRAN and GitHub. Learners will produce R packages that satisfy the criteria for submission to CRAN.</p>
<p><a href="https://www.coursera.org/learn/r-packages" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course17"></a>R 101</h3>
<p>R is a powerful language for data analysis, data visualization, machine learning, statistics. Originally developed for statistical programming, it is now one of the most popular languages in data science. In this course, you&#8217;ll be learning about the basics of R, and you&#8217;ll end with the confidence to start writing your own R scripts. But this isn&#8217;t your typical textbook introduction to R. You&#8217;re not just learning about R fundamentals, you&#8217;ll be using R to solve problems related to movies data. Using a concrete example makes the learning painless.</p>
<p>You will learn about the fundamentals of R syntax, including assigning variables and doing simple operations with one of R&#8217;s most important data structures &#8212; vectors! From vectors, you&#8217;ll then learn about lists, matrix, arrays and data frames. Then you&#8217;ll jump into conditional statements, functions, classes and debugging. Once you&#8217;ve covered the basics &#8211; you&#8217;ll learn about reading and writing data in R, whether it&#8217;s a table format (CSV, Excel) or a text file (.txt). Finally, you&#8217;ll end with some important functions for character strings and dates in R.</p>
<p><a href="https://cognitiveclass.ai/courses/r-101/" target="_blank" rel="noopener noreferrer">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<p><strong>Do you like this list? Subscribe</strong> to the mailing list to get notified of useful R resources.</p>
<div id="newsArrowCenter"></div>
<p>Please help other people to make a good decision, if you’ve taken any of these courses please leave a comment below.</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/18-courses-learn-r-2018/">18 courses to learn R in 2018</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/18-courses-learn-r-2018/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Using R to predict if a customer will buy</title>
		<link>https://www.masterdataanalysis.com/r/using-r-predict-customer-will-buy/</link>
					<comments>https://www.masterdataanalysis.com/r/using-r-predict-customer-will-buy/#respond</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Mon, 23 Oct 2017 19:16:57 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<category><![CDATA[Slider]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=1993</guid>

					<description><![CDATA[<p>In this post, I’ll show how to create a simple model to predict if a customer will buy a product after receiving a marketing campaign. Before I get into the example, I’ll briefly explain the basics about the model I’ll use (Logistic Regression). As shown in the image below, you want a model (function) that [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/using-r-predict-customer-will-buy/">Using R to predict if a customer will buy</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this post, I’ll show how to create a simple model to predict if a customer will buy a product after receiving a marketing campaign.</p>
<p>Before I get into the example, I’ll briefly explain the basics about the model I’ll use (Logistic Regression).</p>
<p>As shown in the image below, you want a model (function) that will get the characteristics of a customer and/or marketing campaign and predict if the customer will buy.</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predictive-Model.png"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-2017" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predictive-Model.png" alt="" width="914" height="246" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predictive-Model.png 914w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predictive-Model-300x81.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predictive-Model-768x207.png 768w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predictive-Model-600x161.png 600w" sizes="(max-width: 914px) 100vw, 914px" /></a></p>
<p>&nbsp;</p>
<p>Once you get the probability, you can define a cutoff value to predict if the customer will buy. For example, you can say that if the probability of buying is greater than 0.5 then the prediction will be that the customer will buy.</p>
<p>To make these concepts easier to explain let’s consider a <u>toy problem</u> where you only have one customer characteristic (yearly income) and you want to predict if the customer will buy.</p>
<p>A subset of the data I’ll use is presented below:</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Sample-Data-Logistic-Regression.png"><img decoding="async" class="aligncenter size-full wp-image-2012" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Sample-Data-Logistic-Regression.png" alt="" width="370" height="200" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Sample-Data-Logistic-Regression.png 370w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Sample-Data-Logistic-Regression-300x162.png 300w" sizes="(max-width: 370px) 100vw, 370px" /></a></p>
<p>Download the data from this <strong><a href="https://drive.google.com/uc?export=download&amp;id=0B4Tqe9kUUfrBY0tSVE5tQk1zb0E" target="_blank" rel="noopener">link</a>.</strong></p>
<p>Here&#8217;s a simple plot of the data</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Plot-of-Buying-Decision-vs-salary.png"><img decoding="async" class="aligncenter size-full wp-image-2013" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Plot-of-Buying-Decision-vs-salary.png" alt="" width="689" height="486" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Plot-of-Buying-Decision-vs-salary.png 689w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Plot-of-Buying-Decision-vs-salary-300x212.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Plot-of-Buying-Decision-vs-salary-600x423.png 600w" sizes="(max-width: 689px) 100vw, 689px" /></a></p>
<p>As you can see from the plot, customers who bought the product tend to have higher income (&gt; $90K/year). Similarly, customers who didn&#8217;t buy the product tend to have lower income (&lt; $90K/year). </p>
<p><strong>Modeling</strong></p>
<p>We want a model to predict the probability of buying a product based on the yearly income of the customer.</p>
<p>One way of creating this model is to use logistic regression. The following figure shows the true buying decisions for each customer (filled points) and the predicted probabilities of buying given by the logistic regression model (empty points). In this case, the cutoff is 0.5, therefore probabilities greater than 0.5 are classified as WILL BUY (blue) and below 0.5 are classified as WILL NOT BUY (red).</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-True-values-and-predicted-probabilities.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2015" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-True-values-and-predicted-probabilities.png" alt="" width="674" height="434" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-True-values-and-predicted-probabilities.png 674w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-True-values-and-predicted-probabilities-300x193.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-True-values-and-predicted-probabilities-600x386.png 600w" sizes="(max-width: 674px) 100vw, 674px" /></a></p>
<p>As shown in the previous figure, the model seems to be working well. For customers most customers who bought the product, the predicted probability of buying is above the cutoff value (0.5), therefore, the prediction is that they will buy. </p>
<p>If you’re more mathematically inclined, the equation used to calculate the predicted probabilities shown on the previous figure is as follows:</p>
<figure id="attachment_1996" aria-describedby="caption-attachment-1996" style="width: 853px" class="wp-caption aligncenter"><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-Probability-customer-will-buy.png"><img loading="lazy" decoding="async" class="size-full wp-image-1996" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-Probability-customer-will-buy.png" alt="" width="853" height="309" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-Probability-customer-will-buy.png 853w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-Probability-customer-will-buy-300x109.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-Probability-customer-will-buy-768x278.png 768w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Logistic-Regression-Probability-customer-will-buy-600x217.png 600w" sizes="(max-width: 853px) 100vw, 853px" /></a><figcaption id="caption-attachment-1996" class="wp-caption-text">Logistic Regression &#8211; Probability a Customer Will Buy</figcaption></figure>
<p>Once you have obtained the values of the coefficients (a and b) [R can do this for you], you can predict the probability of buying for a customer by substituting its corresponding yearly income.</p>
<p>For example, if the values of the parameters are <strong>a = -14.98</strong> and <strong>b = 0.000166</strong>, and the yearly income for a customer is <strong>105,000</strong>; then the predicted probability is calculated as follows:<strong><br />
 <a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predicted-probability-Logistic-Regression.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1998" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predicted-probability-Logistic-Regression.png" alt="" width="551" height="95" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predicted-probability-Logistic-Regression.png 551w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Predicted-probability-Logistic-Regression-300x52.png 300w" sizes="(max-width: 551px) 100vw, 551px" /></a></strong></p>
<p>Assuming a cutoff value of 0.5, since the probability (0.9221) is greater than the cutoff value (0.5), the prediction would be that the customer will buy the product.</p>
<p>Don’t worry, you won’t have to do this manually. This <a href="https://drive.google.com/uc?export=download&amp;id=0B4Tqe9kUUfrBckpIdDJFalRtOU0" target="_blank" rel="noopener">link</a> contains the  R code to get the data, create the graphs and models, and make the predictions.</p>
<p>Note: To learn more about the application of logistic regression to marketing, read Section 9.2 of the book R for Marketing Research and Analytics (Chapman, 2015).</p>
<h2>Real Example: Logistic Regression applied to telemarketing</h2>
<p>&nbsp;</p>
<p>Now that you know the basics, let’s move to a more realistic example. This example comes from the paper: <em>A Data-Driven Approach to Predict the Success of Bank Telemarketing (Moro et Al., 2014)</em> [<a href="https://www.sciencedirect.com/science/article/pii/S016792361400061X" target="_blank" rel="noopener" class="broken_link">Link</a>]<strong>. </strong>The data set for the example contains information about customers and marketing campaigns for several telemarketing campaigns for a Portuguese banking institution.</p>
<p>The goal here is to predict if a customer will subscribe to a term deposit (buy a product) after receiving a telemarketing campaign.</p>
<h3><strong>Data Description</strong></h3>
<p>The variables included in the data are grouped as follows:</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1.png"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-2031" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1-1024x447.png" alt="" width="1024" height="447" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1-1024x447.png 1024w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1-300x131.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1-768x336.png 768w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1-600x262.png 600w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Variables-for-logistic-regression-1.png 1158w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<p>Download the data from this <a href="https://drive.google.com/uc?export=download&amp;id=0B4Tqe9kUUfrBRlVvRzI4OU1naDA" target="_blank" rel="noopener">link</a>, you&#8217;ll need it to follow the next steps.</p>
<h3><strong>Modeling Steps</strong></h3>
<p>I’ll use the caret package to create the model. This is a package with lots of functions to streamline the predictive modeling processes.</p>
<p><strong>Step 1: Import and clean the data</strong></p>
<p>Usually the data cleaning part takes a lot of time and involves several steps such as fixing formatting issues, correcting missing or erroneous values, and standardizing categorical columns.</p>
<p>I won’t cover data cleaning in this post, however please bear in mind the importance of cleaning and plotting the data before going into modeling.</p>
<p>The code below shows how to import the data and to explore each variable using the summary function:</p>
<pre>[code lang="r"]
### Import Data ###
setwd(choose.dir(caption = &quot;Select the folder with the telemarketing data&quot;))
data = read.csv(&quot;bank telemarketing data.csv&quot;)

#Number of rows
nrow(data)

#Explore variables
summary(data)

[/code]</pre>
<p>&nbsp;</p>
<p><strong>Step 2: Split the data in a training and test set</strong></p>
<p>The goal of creating a predictive model is to make predictions about new data. If you use all data available for creating the model, you won’t be able to test the performance of the model with a data set that was not used to create it. Therefore, is good to split the original data set in training and test sets. The training set will be used to create the model and the test set to evaluate the performance of the model in an unseen data set.</p>
<p>In this example, I’ll use 70% of the data for the training set and 30% for the test set.</p>
<p>Here’s the code:</p>
<pre>[code lang="r"]
library(caret)
### Create training and test sets ###
inTrain = createDataPartition(y = data$y, #Variable that we want to predict
                              p = 0.7, #Proportion of values in training set
                              list = FALSE) #Return a vector of indices

#Create training and test sets
TrainingSet = data[inTrain, ]
TestSet     = data[-inTrain, ]
[/code]</pre>
<p>&nbsp;</p>
<p>The <em>createDataPartition</em> function returns the set of indices for the rows of the data set that will be included in the training set.</p>
<p><strong>Step 3: Model creation</strong></p>
<p>I&#8217;ll use the <em>train</em> function from the caret package to fit the logistic regression model. This function is very versatile and capable of fitting many different models. You just need to specify the model type using the <em>method </em>parameter and the additional details required by the method selected.</p>
<p>Examples:</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/train-function-from-Caret.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2008" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/train-function-from-Caret.png" alt="" width="812" height="125" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/train-function-from-Caret.png 812w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/train-function-from-Caret-300x46.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/train-function-from-Caret-768x118.png 768w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/train-function-from-Caret-600x92.png 600w" sizes="(max-width: 812px) 100vw, 812px" /></a></p>
<p>The <em>train</em> function also has parameters for doing model tuning. For more details about this or other functions from the caret package, check the <a href="https://cran.r-project.org/web/packages/caret/vignettes/caret.pdf" target="_blank" rel="noopener" class="broken_link">package vignette</a>.</p>
<p>Here&#8217;s the code to fit the logistic regression model:</p>
<pre>[code lang="r"]
### Train model ###
mod = train(y ~ ., 
            data = TrainingSet, 
            method = &quot;glm&quot;, 
            family = &quot;binomial&quot;)
[/code]</pre>
<p>Logistic regression  is a generalized linear model (glm) with a binomial family. To read more about fitting and analyzing GLMs, check the book: An Introduction to Generalized Linear Models (Dobson, 2008)</p>
<p><strong>Step 4: Check model performance</strong></p>
<p>Now that we have the model, let’s check its performance on the training and tests sets. The most basic performance measure is Overall Accuracy which is the proportion of times the models predicts correctly.</p>
<p>See the code below:</p>
<pre>[code lang="r"]
### Get predictions ###
ptest  = predict(mod, newdata = TestSet)
ptrain = predict(mod, newdata = TrainingSet)

### Accuracy ###

#Accuracy for training set
mean(ptrain == TrainingSet$y)

#Accuracy for Test set
mean(ptest == TestSet$y)
[/code]</pre>
<p>The accuracy for both the training and test sets are: 91.16% and 91.24%. You might get slightly different values.</p>
<p>Pretty good accuracy, right?</p>
<p>PLEASE DON’T FALL INTO THIS TRAP!!!</p>
<p>These high accuracy values might be due to class imbalance in the data sets.</p>
<h3><strong>The class imbalance problem</strong></h3>
<p>Class imbalance happens when the relative frequency of one class (e.g. customers who bought the product) is very low when compared to the other (e.g. customers who didn’t buy the product). This happens in many scenarios:</p>
<ul>
<li>Digital marketing: Click through rate (Only a small proportion of people click on the links)</li>
<li>Banking: Fraud detection (Most transactions are non-fraudulent)</li>
<li>Healthcare: Cancer prediction (Almost all tissues analyzed don’t have cancer cells)</li>
</ul>
<p>The calculation of prediction accuracy can be problematic in imbalanced data sets. Let’s see an example for an email campaign:</p>
<p>Imagine you have a crappy model that <strong><u>always</u></strong> predicts that customers WILL NOT click on the links sent to them. In other words, this model will FAIL ALL predictions for customers who clicked on the links.</p>
<p>Suppose we are evaluating the accuracy of this model with an imbalanced data set (Out of 10,000 customers only 100 clicked): </p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-imbalanced-dataset.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2004" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-imbalanced-dataset.png" alt="" width="747" height="76" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-imbalanced-dataset.png 747w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-imbalanced-dataset-300x31.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-imbalanced-dataset-600x61.png 600w" sizes="(max-width: 747px) 100vw, 747px" /></a>For this same model, let&#8217;s evaluate the accuracy for a balanced data set (Out of 10,000 customers; 5,000 cliked):</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-balanced-dataset.png"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-2005" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-balanced-dataset.png" alt="" width="351" height="70" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-balanced-dataset.png 351w, https://www.masterdataanalysis.com/wp-content/uploads/2017/10/Accuracy-for-balanced-dataset-300x60.png 300w" sizes="(max-width: 351px) 100vw, 351px" /></a></p>
<p>As you can see, the high accuracy observed with the imbalanced data set is due to the nature of the data set and not the performance of the model. Fortunately, you can use other metrics to measure the performance of models such as Precision, Recall, and Area Under the ROC curve.</p>
<p>Unfortunately, class imbalance has negative effects in the true performance of the models. In other words, if you train the models using an imbalanced data set this might cause the models to predict incorrectly in a frequency higher than expected.</p>
<p>What can you do if you have to deal with the common problem of class imbalance? <strong>Easy, subscribe to the blog!</strong>  I&#8217;ll write another post about multiple ways of dealing with class imbalance.</p>
<p>&nbsp;</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/using-r-predict-customer-will-buy/">Using R to predict if a customer will buy</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/using-r-predict-customer-will-buy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Data Science for Beginners</title>
		<link>https://www.masterdataanalysis.com/r/data-science-for-beginners/</link>
					<comments>https://www.masterdataanalysis.com/r/data-science-for-beginners/#respond</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Tue, 20 Jun 2017 10:07:36 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=1977</guid>

					<description><![CDATA[<p>Are you wondering what&#8217;s all this buzz about data science? The following videos will give you a good introduction to data science. Use the links below to go to each video: Problems solved by data science Data Quality Question/Problem Quality Example of linear regression model    Problems solved by data science   The first video [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/data-science-for-beginners/">Data Science for Beginners</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Are you wondering what&#8217;s all this buzz about data science? The following videos will give you a good introduction to data science.</p>
<p>Use the links below to go to each video:</p>
<ul>
<li><a href="#DataScience">Problems solved by data science</a></li>
<li><a href="#DataQuality">Data Quality</a></li>
<li><a href="#ProblemQuality">Question/Problem Quality</a></li>
<li><a href="#LinearRegression">Example of linear regression model</a></li>
</ul>
<div>  </div>
<div>
<div><a id="DataScience"></a><strong>Problems solved by data science</strong></div>
<div> </div>
</div>
<div>The first video is about the five questions/problems that data science can answer.</div>
<div></p>
<div>
<table style="height: 212px; width: 719px;">
<tbody>
<tr>
<td style="width: 187px;"><strong>Question</strong></td>
<td style="width: 187px;"><strong>Problem</strong></td>
<td style="width: 329px;"><strong>Example</strong></td>
</tr>
<tr>
<td style="width: 187px;">
<div>Is this A or B or C?  </div>
</td>
<td style="width: 187px;">Classification  </td>
<td style="width: 329px;">Will this customer leave or not? </td>
</tr>
<tr>
<td style="width: 187px;">
<div>Is this weird?  </div>
</td>
<td style="width: 187px;">Anomaly detection</td>
<td style="width: 329px;">Is this transaction typical when compared to other transactions from this credit card?</td>
</tr>
<tr>
<td style="width: 187px;">
<div>How much/many?  </div>
</td>
<td style="width: 187px;">Regression  </td>
<td style="width: 329px;">What will be the sales for the following six months?</td>
</tr>
<tr>
<td style="width: 187px;">How is this organized? </td>
<td style="width: 187px;">Clustering </td>
<td style="width: 329px;">What are the groups of similar customers in this marketing database </td>
</tr>
<tr>
<td style="width: 187px;">What should I do next?</td>
<td style="width: 187px;">Reinforcement learning </td>
<td style="width: 329px;">In a self-driven car should  I stop or accelerate if I see a yellow light.</td>
</tr>
</tbody>
</table>
</div>
<div> </div>
</div>
<div><iframe src="https://www.youtube.com/embed/0XyV91VYrDs?list=PLLasX02E8BPB997krgQN3V9UmUBRVKpmD" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<div> </div>
<div>
<div><a id="DataQuality"></a><strong>Data Quality</strong></div>
<div> </div>
<div>To have good data science models, data should be:</div>
<ul>
<li><strong>Relevant</strong> to the problem you&#8217;re solving</li>
<li><strong>Connected</strong> (with the least number of missing values as possible)</li>
<li><strong>Accurate</strong> (with low bias)</li>
<li><strong>Enough</strong> to work with</li>
</ul>
</div>
<div> </div>
<div><iframe src="https://www.youtube.com/embed/FVgJe4iDZ3Y?list=PLLasX02E8BPB997krgQN3V9UmUBRVKpmD" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<div> </div>
<div>
<div><a id="ProblemQuality"></a><strong>Problem Quality</strong></div>
<div> </div>
<div>Try to make the questions as precise as possible and to have adequate data for the problem you&#8217;re solving. For example, if your question is: <em>what are going to be the sales for the next six months?</em>, then you should have historical sales data.</div>
</div>
<div> </div>
<div><iframe src="https://www.youtube.com/embed/nBoybSf7jwo?list=PLLasX02E8BPB997krgQN3V9UmUBRVKpmD" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<div>
<div> </div>
<div><a id="LinearRegression"></a><strong>Example of linear regression model</strong></div>
<div> </div>
<div>In this video you&#8217;ll see how to make predictions of diamonds price based on the carats of them using a simple linear regression model.</div>
</div>
<div> </div>
<div>
<div> </div>
<p><iframe src="https://www.youtube.com/embed/91myVwC3Wwk?list=PLLasX02E8BPB997krgQN3V9UmUBRVKpmD" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<div> </div>
<div><strong>Getting Started With Azure Machine Learning</strong></div>
<div> </div>
<div>One possible way of getting started in data science is to explore existing solutions to data science problems. The following video explains how to use existing solutions in Azure Machine Learning.</div>
<div> </div>
</div>
<p><iframe src="https://www.youtube.com/embed/iVlqFY71xec?list=PLLasX02E8BPB997krgQN3V9UmUBRVKpmD" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><strong>If you&#8217;re interested in learning more about data science, machine learning or R programming, please subscribe to the blog.</strong></p>
<p>The post <a href="https://www.masterdataanalysis.com/r/data-science-for-beginners/">Data Science for Beginners</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/data-science-for-beginners/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating animations from ggplot2 plots</title>
		<link>https://www.masterdataanalysis.com/r/creating-animations-ggplot2-plots/</link>
					<comments>https://www.masterdataanalysis.com/r/creating-animations-ggplot2-plots/#respond</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Tue, 14 Feb 2017 18:24:56 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=1864</guid>

					<description><![CDATA[<p>Note: This post was published on February 14th (Valentine&#8217;s day) First things first, Marioly, thanks for being a loving wife and an exceptional mother. Here’s an infinite love animation for you: In this post I&#8217;ll show you to use the gganimate package from David Robinson to create animations from ggplot2 plots. The animation shown above is [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/creating-animations-ggplot2-plots/">Creating animations from ggplot2 plots</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><em>Note: This post was published on February 14th (Valentine&#8217;s day)</em></p>
<p>First things first, Marioly, thanks for being a loving wife and an exceptional mother. Here’s an infinite love animation for you:</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/heart-curve-animation-with-gganimate.gif"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1876" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/heart-curve-animation-with-gganimate.gif" alt="" width="540" height="600" /></a></p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/ggplot2-animations-with-gganimate.gif"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1865" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/ggplot2-animations-with-gganimate.gif" alt="" width="1" height="1" /></a></p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/ggplot2-animations-with-gganimate.gif"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-1865" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/ggplot2-animations-with-gganimate.gif" alt="" width="1" height="1" /></a></p>
<p>In this post I&#8217;ll show you to use the <a href="https://github.com/dgrtwo/gganimate">gganimate</a> package from <a href="http://varianceexplained.org/">David Robinson</a> to create animations from ggplot2 plots.</p>
<p>The animation shown above is composed by two curves:</p>
<ul>
<li>The top one (infinity shape) is a <a href="http://mathworld.wolfram.com/Lemniscate.html">Lemniscate of Bernoulli</a> and can be created with the following parametric equations:</li>
</ul>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Lemniscate-of-Bernoulli-Parametric-Equations.png"><img loading="lazy" decoding="async" class="size-full wp-image-1869 aligncenter" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Lemniscate-of-Bernoulli-Parametric-Equations.png" alt="" width="275" height="175" /></a></p>
<ul>
<li>The bottom one (heart shape) is a <a href="http://mathworld.wolfram.com/HeartCurve.html">heart curve</a> with the following parametric equations:</li>
</ul>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Heart-Curve-Parametric-Equations.png"><img loading="lazy" decoding="async" class="size-full wp-image-1871 aligncenter" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Heart-Curve-Parametric-Equations.png" alt="" width="561" height="120" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/02/Heart-Curve-Parametric-Equations.png 561w, https://www.masterdataanalysis.com/wp-content/uploads/2017/02/Heart-Curve-Parametric-Equations-300x64.png 300w" sizes="(max-width: 561px) 100vw, 561px" /></a></p>
<p>If you want to plot these curves without animating them, the code is extremely easy with ggplot2:</p>
<pre>[code lang="r"]
## Import required packages ##
library(ggplot2)
library(dplyr)

## Create data frame with values for both parametric equations ##
heartdf = data_frame(
  t = seq(0, 2*pi, pi/60), 
  x = 16*sin(t)^3, #x values for heart curve
  y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t), #y values for heart curve
  x2 = 3*sqrt(2)*cos(t)/(sin(t)^2 + 1), #x values for leminiscate
  y2 = 20 + 4*sqrt(2)*cos(t)*sin(t)/(sin(t)^2 + 1) #y values for lemniscate
  )

## Create plot ##
p = ggplot(data = heartdf, aes(x, y)) + 
  geom_path(aes(group = 1)) +
  geom_path(aes(group = 1, x = x2, y= y2), size = 2, colour = &quot;red&quot;) +
  geom_polygon(aes(group = 1), fill = &quot;red&quot;) +
  geom_text(aes(x = 0, y = 0, label = &quot;Happy Valentine's Day \n Marioly!!!&quot;), 
            size = 10, colour = &quot;white&quot;)

p
[/code]</pre>
<p>If you want animate the plot, you can use <a href="https://github.com/dgrtwo/gganimate">gganimate</a>. This package allows you to add an aesthetic component related to a frame (time) variable and it creates the animation by looping through each value of the frame variable and joins the plot with ImageMagick.</p>
<p>Before starting you will need to install gganimate and ImageMagick:</p>
<pre>[code lang="r"]
# install gganimate from GitHub
library(devtools)
install_github(&quot;dgrtwo/gganimate&quot;)

# install ImageMagick
library(installr)
install.ImageMagick()
[/code]</pre>
<p>This is the code for the animation:</p>
<pre>[code lang="r" highlight="17, 21, 26, 28, 29"]
# Import packages #
library(ggplot2)
library(dplyr)
library(animation)
library(gganimate)

## Create data frame with values for both parametric equations ##
heartdf = data_frame(
 t = seq(0, 2*pi, pi/60),
 x = 16*sin(t)^3,
 y = 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t),
 x2 = 3*sqrt(2)*cos(t)/(sin(t)^2 + 1),
 y2 = 20 + 4*sqrt(2)*cos(t)*sin(t)/(sin(t)^2 + 1)
)

# Create frame variable for text #
textdf = data_frame(t = max(heartdf$t) + 1:25)

# Create plot #
p = ggplot(data = heartdf, 
           aes(x, y, frame = round(t, 1), cumulative = TRUE)) + 
 geom_path(aes(group = 1)) +
 geom_path(aes(group = 2, x = x2, y= y2), size = 2, colour = &quot;red&quot;) +
 geom_polygon(aes(group = 1), fill = &quot;red&quot;) +
 geom_text(aes(x = 0, y = 0, label = &quot;Happy Valentine's Day \n Marioly!!!&quot;, 
           frame = t), data = textdf, size = 10, colour = &quot;white&quot;)

ani.options(interval = 0.06) #animation speed, seconds per frame
gganimate(p, title_frame = FALSE)
[/code]</pre>
<p>Notice that is very similar to the code without animation, the only differences are:</p>
<ul>
<li>Creation of frame variable for the text to appear after the shapes have been plotted</li>
<li>Use of the frame variable and the cumulative argument to keep the previous plots once they have plotted</li>
<li>Modification of geom_text to include the frame data and aesthetic</li>
<li>Set the speed of the animation with ani.options and create the animation</li>
</ul>
<p>&nbsp;</p>
<h4>Simple Example: Changing the shape parameters of the Beta distribution</h4>
<p>The Beta distribution defined as:</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Distribution.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1887" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Distribution.png" alt="" width="837" height="90" srcset="https://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Distribution.png 837w, https://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Distribution-300x32.png 300w, https://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Distribution-768x83.png 768w, https://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Distribution-600x65.png 600w" sizes="(max-width: 837px) 100vw, 837px" /></a></p>
<p>is one of the most flexible distributions since it can take very different shapes depending on the selection of the shape parameters (α and β).</p>
<p>See below:</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Animation-parameters.gif"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1908" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Beta-Animation-parameters.gif" alt="" width="550" height="550" /></a></p>
<p>The code to create the plot above is:</p>
<pre>[code lang="r" highlight="28, 37, 38"]
## Import packages ##
library(ggplot2)
library(dplyr)
library(tidyr)
library(purrr)
library(animation)
library(gganimate)

## Function to evaluate Beta pdf for a vector of values ##
calc_beta = function(alpha, beta){
  x = seq(0.01, 0.99, 0.01)
  densityf = dbeta(x, shape = alpha, shape2 = beta)
  return(data_frame(x, densityf))
}

## Create data frame with evaluation of Beta pdf for different combinations of alpha and beta ##
alpha = c(0.1, 0.5, 1:5, 10)
beta = c(0.5, 1, 2, 5)

## Create data frame ## 
# Couldn't get the pipe operator to properly show up in WordPress :-(
df = expand.grid(alpha = alpha, beta = beta)
df = group_by(df, alpha, beta) 
df = unnest(mutate(df, plotdata = map2(alpha, beta, calc_beta)))

## Create plot ##
p = ggplot(df, aes(x = x, y = densityf, colour = factor(alpha), group = factor(alpha))) + 
  geom_path(aes(frame = alpha, cumulative = TRUE), size = 0.5) +
  facet_wrap(~beta, 
             labeller = label_bquote(cols = beta == .(beta))) +
  ylim(c(0, 6)) +
  labs(y = expression(paste(&quot;f(x; &quot;, alpha, &quot;, &quot;, beta, &quot;)&quot;)),
       title = &quot;Changing parameters in Beta density function&quot;) +
  scale_colour_discrete(name = expression(alpha)) +
  theme(plot.title = element_text(hjust = 0.5))

ani.options(interval = 0.8)
gganimate(p, title_frame = FALSE, width = 4, height = 4)
[/code]</pre>
<p>If you take a close look at the code, you&#8217;ll notice that with <strong>only 3 lines of code</strong> (the ones highlighted) you can create the animation. All other lines of code are required for the static version of the plot.</p>
<p><strong><u>Important note</u></strong>: Make sure to Run your IDE (RStudio, RTVS, …) as Administrator to create the animations.</p>
<h3>Additional Examples</h3>
<p>Here are a couple scenarios, taken from <a href="https://www.youtube.com/watch?v=9Y7Y1s4-VdA">David&#8217;s presentation</a> in PlotCon,  where animation might come handy:</p>
<ul>
<li>
<h4>Adding a time dimension to a highly dimensional plot:</h4>
</li>
</ul>
<p>The plot below has 4 dimensions: x (GPD per capita), y (Life expectancy), color (continent), size (population). With an animation, you can add a 5<sup>th</sup> dimension (time) and see the change through time.</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/gapminder-animation-with-gganimate.gif"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1911" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/gapminder-animation-with-gganimate.gif" alt="" width="504" height="504" /></a></p>
<p>&nbsp;</p>
<p>This animation is very similar (conceptually) to the ones created by the late, great <a href="https://www.youtube.com/watch?v=jbkSRLYSojo">Hans Rosling</a>.</p>
<ul>
<li>
<h4>To explain concepts easier to understand with animations</h4>
</li>
</ul>
<p>Relationship between trigonometric functions and x and y axis lengths in a unit circle</p>
<p><a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Trigonometric-functions-animations.gif"><img loading="lazy" decoding="async" class="aligncenter  wp-image-1912" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/Trigonometric-functions-animations.gif" alt="" width="717" height="148" /></a></p>
<p><a href="https://gist.github.com/expersso/944f3d4aad15f71b192fff254d4ac5b9">Source</a></p>
<ul>
<li>
<h4>Spatio-Temporal data visualization</h4>
</li>
</ul>
<p>For example, the animation below shows the position of the players of each team and the ball for a basketball game. It also shows the <a href="https://en.wikipedia.org/wiki/Convex_hull">convex hull</a> of the positions of the players.<a href="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/basketball-game-animation-with-gganimate-2.gif"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1915" src="http://www.masterdataanalysis.com/wp-content/uploads/2017/02/basketball-game-animation-with-gganimate-2.gif" alt="" width="600" height="450" /></a></p>
<p><a href="http://curleylab.psych.columbia.edu/nba.html">Source</a></p>
<p>Well that’s all for now!</p>
<p>For any doubts/requests about the gganimate package, please go to: <a href="http://stackoverflow.com/questions/tagged/gganimate" class="broken_link">gganimate questions</a> / <a href="https://github.com/dgrtwo/gganimate">gganimate GitHub page</a></p>
<p><span style="font-size: 14pt;"><strong>Subscribe to the site to get notified when new posts come up!</strong></span></p>
<p>The post <a href="https://www.masterdataanalysis.com/r/creating-animations-ggplot2-plots/">Creating animations from ggplot2 plots</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/creating-animations-ggplot2-plots/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Attend the R User Conference 2016 &#8211; Online</title>
		<link>https://www.masterdataanalysis.com/r/attend-r-user-conference-2016-online/</link>
					<comments>https://www.masterdataanalysis.com/r/attend-r-user-conference-2016-online/#respond</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Sun, 26 Jun 2016 23:15:34 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<category><![CDATA[Data Science]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[R Programming]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=1560</guid>

					<description><![CDATA[<p>The R User Conference is one of the biggest R conferences around the world. It will be held at Stanford University during Jun 27 &#8211; 30, 2016. The conference is full already, however, if you want to see the presentations online you’ll be able to do so through the next link: Watch Presentations Online  The [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/attend-r-user-conference-2016-online/">Attend the R User Conference 2016 &#8211; Online</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The R User Conference is one of the biggest R conferences around the world. It will be held at Stanford University during Jun 27 &#8211; 30, 2016.</p>
<p>The conference is full already, however, if you want to see the presentations online you’ll be able to do so through the next link:</p>
<p style="text-align: center;"><a href="https://channel9.msdn.com/events/useR-international-R-User-conference/useR2016" target="_blank"><button>Watch Presentations Online</button></a> </p>
<p><strong>The program will cover topics such as</strong></p>
<ul>
<li>History of R and computing with data</li>
<li>Bayesian Statistics</li>
<li>Bioinformatics</li>
<li>Economics, Finance and Insurance</li>
<li>High Performance Computing</li>
<li>Reproducible Research</li>
<li>Industrial Applications</li>
<li>Statistical Learning with Big Data</li>
<li>Spatial Statistics</li>
<li>Teaching</li>
<li>Visualization &amp; Graphics</li>
<li>and many more.</li>
</ul>
<p><a href="http://user2016.org/" target="_blank">Click here</a> to go to the website of the conference.</p>
<p>After all presentations are available, I’ll select my favorites and share them in this post.</p>
<p>I’m already looking forward to the following presentations:</p>
<p><strong>Visualization</strong></p>
<ul>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Towards-a-grammar-of-interactive-graphics" target="_blank">Towards a grammar of interactive graphics</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/flexdashboard-Easy-interactive-dashboards-for-R" target="_blank">Flexdashboard: Easy interactive dashboards for R</a></li>
</ul>
<p><strong>Performance and Big Data</strong></p>
<ul>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Taking-R-to-new-heights-for-scalability-and-performance" target="_blank">Taking R to new heights for scalability and performance</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Distributed-Computing-using-parallel-Distributed-R-and-SparkR" target="_blank"> Distributed Computing using parallel, Distributed R, and SparkR</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Exploring-the-R--SQL-boundary" target="_blank"> Exploring the R / SQL boundary</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/How-Teradata-Aster-R-Scales-Data-Science" target="_blank"> How Teradata Aster R Scales Data Science</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Size-of-Datasets-for-Analytics-and-Implications-for-R" target="_blank">Size of Datasets for Analytics and Implications for R</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/R-for-Big-Data-and-Applications-Using-R-at-Oracle" target="_blank"> R for Big Data and Applications: Using R at Oracle</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/RCloud-Collaborative-Environment-for-Visualization-and-Big-Data-Analytics" target="_blank"> RCloud &#8211; Collaborative Environment for Visualization and Big Data Analytics</a></li>
</ul>
<p><strong>IDEs and GUIs</strong></p>
<ul>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/A-Lap-Around-R-Tools-for-Visual-Studio" target="_blank">A Lap Around R Tools for Visual Studio</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/R-AnalyticFlow-3-Interactive-Data-Analysis-GUI-for-R" target="_blank"> R AnalyticFlow 3: Interactive Data Analysis GUI for R</a></li>
</ul>
<p><strong>Use of R at big companies</strong></p>
<ul>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Changing-lives-with-Data-Science-at-Microsoft" target="_blank">Changing lives with Data Science at Microsoft</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/R-at-Microsoft" target="_blank">R at Microsoft</a></li>
</ul>
<p><strong>Modeling</strong></p>
<ul>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Fast-additive-quantile-regression-in-R" target="_blank">Fast additive quantile regression in R</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/R-in-machine-learning-competitions" target="_blank">R in machine learning competitions</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Multiple-Hurdle-Tobit-models-in-R-The-mhurdle-package" target="_blank">Multiple Hurdle Tobit models in R: The mhurdle package</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/When-will-this-machine-fail" target="_blank">When will this machine fail?</a></li>
</ul>
<p><strong>Other</strong></p>
<ul>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Using-R-in-a-regulatory-environment-FDA-experiences" target="_blank">Using R in a regulatory environment: FDA experiences.</a></li>
<li><a href="https://channel9.msdn.com/Events/useR-international-R-User-conference/useR2016/Importing-modern-data-into-R" target="_blank">Importing modern data into R</a></li>
</ul>
<p><span style="font-size: 14pt;"><strong>If you want to be notified about other news like this one, please subscribe.</strong></span></p>
<p>The post <a href="https://www.masterdataanalysis.com/r/attend-r-user-conference-2016-online/">Attend the R User Conference 2016 &#8211; Online</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/attend-r-user-conference-2016-online/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>16 courses to learn R in 2016</title>
		<link>https://www.masterdataanalysis.com/r/16-courses-to-learn-r-in-2016/</link>
					<comments>https://www.masterdataanalysis.com/r/16-courses-to-learn-r-in-2016/#comments</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Tue, 19 Jan 2016 12:28:17 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<category><![CDATA[R Programming]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=1275</guid>

					<description><![CDATA[<p>Do you want to learn or get better at R programming?  If yes, you will love the list below. I have compiled a list of free and paid R programming courses. Most of them are online and free, so NO excuses about location or money to uplift your skills. The link in the Description column [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/16-courses-to-learn-r-in-2016/">16 courses to learn R in 2016</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Do you want to learn or get better at R programming?</p>
<p> If yes, you will love the list below. I have compiled a list of free and paid R programming courses. Most of them are online and free, so NO excuses about location or money to uplift your skills.</p>
<p>The link in the <em>Description</em> column will take you to a general description of the course and the link in the <em>Link to course</em> column will take you to the course website. </p>
<h2><a id="Courses_Table"></a>Courses Table</h2>
<table style="border-color: #050505; width: 771px; height: 776px; text-align: center;">
<tbody>
<tr>
<td style="width: 171px;"><strong>Name of Course</strong></td>
<td style="width: 83px;"><strong>Cost</strong></td>
<td style="width: 170px;"><strong>Company/University</strong></td>
<td style="width: 126px;"><strong>Start Date</strong></td>
<td style="width: 97px;"><strong>Description</strong></td>
<td style="width: 178px;"><strong>Link to course</strong></td>
</tr>
<tr>
<td style="width: 171px;">The Analytics Edge</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">MIT (EdX)</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"> <a href="#Course1">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/analytics-edge-mitx-15-071x-2"> Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Statistical Learning</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Stanford Online</td>
<td style="width: 126px;">12-Jan-2016</td>
<td style="width: 97px;"><a href="#Course2">Link</a></td>
<td style="width: 178px;"><a href="https://lagunita.stanford.edu/courses/HumanitiesSciences/StatLearning/Winter2016/about" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">R Programming</td>
<td style="width: 83px;">Free/$49</td>
<td style="width: 170px;">Johns Hopkins<br />
 University</td>
<td style="width: 126px;">03-Oct-2016</td>
<td style="width: 97px;"><a href="#Course3">Link</a></td>
<td style="width: 178px;"><a href="https://www.coursera.org/learn/r-programming">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Introduction to<br />
 R Programming</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Microsoft</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course4">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/introduction-r-programming-microsoft-dat204x-0" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Google Developers<br />
 R Programming</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Google Developers</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course5">Link</a></td>
<td style="width: 178px;"><a href="https://www.youtube.com/watch?v=iffR3fWv4xw&amp;list=PLOU2XLYxmsIK9qQfztXeybpHvru-TrqAP">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Data Analysis<br />
 with R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Udacity</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course6">Link</a></td>
<td style="width: 178px;"><a href="https://www.udacity.com/course/data-analysis-with-r--ud651">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Data Science<br />
 with R</td>
<td style="width: 83px;">$2,190</td>
<td style="width: 170px;">NYC Data Science Academy</td>
<td style="width: 126px;">22-Oct-2016</td>
<td style="width: 97px;"><a href="#Course7">Link</a></td>
<td style="width: 178px;"><a href="https://nycdatascience.com/courses/data-science-with-r-data-analysis/" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Introduction to R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">DataCamp</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course8">Link</a></td>
<td style="width: 178px;"><a href="https://www.datacamp.com/courses/free-introduction-to-r" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Statistical Computing<br />
 with R Programming<br />
 Language</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">University College London</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course9">Link</a></td>
<td style="width: 178px;"><a href="https://www.ucl.ac.uk/lifelearning/courses/statistical-computing-r-programming-introduction">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Learning To Program<br />
 With R</td>
<td style="width: 83px;">$49.50</td>
<td style="width: 170px;">Infinite Skills, Inc</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course10">Link</a></td>
<td style="width: 178px;"><a href="https://www.infiniteskills.com/training/learning-to-program-with-r.html">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">R Basics – R <br />
 Programming Language<br />
 Introduction</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Udemy</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course11">Link</a></td>
<td style="width: 178px;"><a href="https://www.udemy.com/r-basics/" class="broken_link">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Data Wrangling<br />
 in R</td>
<td style="width: 83px;">$149/$490</td>
<td style="width: 170px;"><a href="https://experfy.com/">Experfy.com</a></td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course12">Link</a></td>
<td style="width: 178px;"><a href="https://www.experfy.com/training/courses/data-wrangling-in-r">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">R Programming<br />
 – Introduction</td>
<td style="width: 83px;">$549</td>
<td style="width: 170px;"><a href="https://www.statistics.com">Statistics.com</a></td>
<td style="width: 126px;">04-Nov-2016</td>
<td style="width: 97px;"><a href="#Course13">Link</a></td>
<td style="width: 178px;"><a href="https://www.statistics.com/r-programming-intro-1/#syllabus">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Statistics Using R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">UTAustinX</td>
<td style="width: 126px;">2-Feb-2016</td>
<td style="width: 97px;"><a href="#Course14">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/foundations-data-analysis-part-1-utaustinx-ut-7-10x#.VGdFKmf4bIU">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Try R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Codeschool</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course15">Link</a></td>
<td style="width: 178px;"><a href="https://www.codeschool.com/courses/try-r">Link</a></td>
</tr>
<tr>
<td style="width: 171px;">Explore Statistics<br />
 with R</td>
<td style="width: 83px;">Free</td>
<td style="width: 170px;">Karolinska Institutet</td>
<td style="width: 126px;">Self-Paced</td>
<td style="width: 97px;"><a href="#Course16">Link</a></td>
<td style="width: 178px;"><a href="https://www.edx.org/course/explore-statistics-r-kix-kiexplorx-0" class="broken_link">Link</a></td>
</tr>
</tbody>
</table>
<h2>Courses Descriptions</h2>
<h3><a id="Course1"></a>The Analytics Edge</h3>
<p>What you&#8217;ll learn: An applied understanding of many different analytics methods, including linear regression, logistic regression, CART, clustering, and data visualization. <br />
 How to implement all of these methods in R. <br />
 An applied understanding of mathematical optimization and how to solve optimization models in spreadsheet software.</p>
<p><a href="https://www.edx.org/course/analytics-edge-mitx-15-071x-2" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course2"></a>Statistical Learning</h3>
<p>“This is an introductory-level course in supervised learning, with a focus on regression and classification methods. The syllabus includes: linear and polynomial regression, logistic regression and linear discriminant analysis; cross-validation and the bootstrap, model selection and regularization methods (ridge and lasso); nonlinear models, splines and generalized additive models; tree-based methods, random forests and boosting; support-vector machines. Some unsupervised learning methods are discussed: principal components and clustering (k-means and hierarchical).</p>
<p>This is not a math-heavy class, so we try and describe the methods without heavy reliance on formulas and complex mathematics. We focus on what we consider to be the important elements of modern data analysis. Computing is done in R. There are lectures devoted to R, giving tutorials from the ground up, and progressing with more detailed sessions that implement the techniques in each chapter.</p>
<p>The lectures cover all the material in An Introduction to Statistical Learning, with Applications in R by James, Witten, Hastie and Tibshirani (Springer, 2013). The pdf for this book is available for free on the book website.”</p>
<p><a href="https://lagunita.stanford.edu/courses/HumanitiesSciences/StatLearning/Winter2016/about" target="_blank" rel="noopener" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course3"></a>R Programming</h3>
<p>In this course you will learn how to program in R and how to use R for effective data analysis. You will learn how to install and configure software necessary for a statistical programming environment and describe generic programming language concepts as they are implemented in a high-level statistical language.</p>
<p>The course covers practical issues in statistical computing which includes programming in R, reading data into R, accessing R packages, writing R functions, debugging, profiling R code, and organizing and commenting R code. Topics in statistical data analysis will provide working examples.</p>
<p><a href="https://www.coursera.org/learn/r-programming" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course4"></a>Introduction to R Programming</h3>
<p>“This introduction to R programming course will help you master the basics of R. In seven sections, you will cover its basic syntax, making you ready to undertake your own first data analysis using R.</p>
<p>Starting from variables and basic operations, you will learn how to handle data structures such as vectors, matrices, data frames and lists. In the final section, you will dive deeper into the graphical capabilities of R, and create your own stunning data visualizations. No prior knowledge in programming or data science is required.</p>
<p>What makes this R programming course unique is that you will continuously practice your newly acquired skills through interactive in-browser coding challenges using the DataCamp platform.</p>
<p>Instead of passively watching videos, you will solve real data problems while receiving instant and personalized feedback that guides you to the correct solution.”</p>
<p><a href="https://www.edx.org/course/introduction-r-programming-microsoft-dat204x-0" target="_blank" rel="noopener" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course5"></a>Google Developers R Programming</h3>
<p>Short videos about R programming from Google Developers</p>
<p><a href="https://www.youtube.com/watch?v=iffR3fWv4xw&amp;list=PLOU2XLYxmsIK9qQfztXeybpHvru-TrqAP" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course6"></a>Data Analysis with R</h3>
<p>Exploratory data analysis is an approach for summarizing and visualizing the important characteristics of a data set. Promoted by John Tukey, exploratory data analysis focuses on exploring data to understand the data’s underlying structure and variables, to develop intuition about the data set, to consider how that data set came into existence, and to decide how it can be investigated with more formal statistical methods.</p>
<p><a href="https://www.udacity.com/course/data-analysis-with-r--ud651" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course7"></a>Data Science with R</h3>
<p>This intensive Data Science with R – Beginner Level course being offered by NYC Data Science Academy is a five week course that will introduce you to the wonderful world of R and provide you with an excellent understanding of the language that leaves you with a firm foundation to build upon.</p>
<p>Why R is important: R is a powerful, comprehensive, and dynamic programming language that, since its release in 1996, is on course to eclipse traditional statistical packages as the dominant interface in computational statistics, visualization, and data science.</p>
<p>And another thing: it’s free! As an open-source platform, R has grown to become an incredibly flexible tool that can be applied to nearly every graphical and statistical problem. The community of R users is continuing to build new functionality to the language, and R is often the first statistical tool to provide support for new algorithms and cutting-edge methods in data science.</p>
<p><a href="https://nycdatascience.com/courses/data-science-with-r-data-analysis/" target="_blank" rel="noopener" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course8"></a>Introduction to R</h3>
<p>With over 2 million users worldwide R is rapidly becoming the leading programming language in statistics and data science. Every year, the number of R users grows by 40%, and an increasing number of organizations are using it in their day-to-day activities.</p>
<p>In this introduction to R, you will master the basics of this beautiful open source language such as factors, lists and data frames. With the knowledge gained in this course, you will be ready to undertake your first very own data analysis.</p>
<p><a href="https://www.datacamp.com/courses/free-introduction-to-r" target="_blank" rel="noopener" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course9"></a>Statistical Computing with R Programming Language</h3>
<p>“This short course is for anyone who wants to learn the basics of R, and computer programming in general, although the tasks focus on examples from the biosciences. It’s suitable for undergraduates, graduates and researchers from any field that uses statistical computing.”</p>
<p><a href="https://www.ucl.ac.uk/lifelearning/courses/statistical-computing-r-programming-introduction" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course10"></a>Learning To Program With R</h3>
<p>In this Learning R training course, expert author Stuart Greenlee will teach you how to use R, a programming language used for statistical computing and graphics. This course is designed for beginners that have no previous R programming experience. You will require a fundamental understanding of statistics to get the most out of this course.</p>
<p>You will start by learning how to install and navigate R studio, then move into learning basic operations like statistical functions, matrix operations, and string functions. Stuart will show you how to plot, including scatter plots, probability plots, and plotting arguments.</p>
<p>This video tutorial will cover working with data and data analysis, such as extracting model information, examining files and objects, and subsetting and indexing. You will also learn about conditional statements and user-defined functions, including how to write and de-bug functions.</p>
<p>Finally, you will learn how to save different types of data.Once you have completed this computer based training course, you will be fully capable of using R for developing statistical software and data analysis tools. Working files are included, allowing you to follow along with the author throughout the lessons.</p>
<p><a href="https://www.infiniteskills.com/training/learning-to-program-with-r.html" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course11"></a>R Basics – R Programming Language Introduction</h3>
<p>“This course was created by R Tutorials. It is meant to give you an introductory understanding of the R language. It takes about 2 hr (+ the time you need to solve the exercises) to complete this course. This is just enough time for a brief introduction.</p>
<p>R programming becomes more and more popular since it is fully open source and reacts very dynamic to new developments.Nowadays it is vital in many scientific or other analytical fields to have a good understanding of the R language. With this course you can build a very solid foundation to later on branch out to the various applications R has to offer.</p>
<p>You will learn about basic commands like “”paste””, “”seq””, “”rep”” and you will also see how graphs are created in R.</p>
<p>We use RStudio as our user interface. You will quickly see that this software makes using R much easier. This course is totally free to you – it is the perfect chance to get familiar with R programming.”</p>
<p><a href="https://www.udemy.com/r-basics/" target="_blank" rel="noopener" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course12"></a>Data Wrangling in R</h3>
<p>R is an extraordinarily powerful language with a vast community of great resources, but where should you start when all you want to do is get your data into a usable format? How do you know your data might be ready? What are the pitfalls you should watch for so that you don’t perform an analysis on bad data?</p>
<p>This course will teach you from start to finish how to get your data into R efficiently and polish it up so that it is as good as it can be. This will let you or your team focus after this step on the statistical modeling, visualization, reporting, sharing, or any other post-processing task you wish to perform. Confidence, reliability, and reproducibility in your data acquisition and preparation are the kingpins to being able to maximize your data’s value.</p>
<p><a href="https://www.experfy.com/training/courses/data-wrangling-in-r" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course13"></a>R Programming – Introduction</h3>
<p>In this online course, “R Programming Intro 1”, you will be introduced to basic concepts in computer programming via R – it is for those who have had little or no experience in programming.</p>
<p>You will learn how to get going in R from the beginning, understand file formats and basic R syntax, and learn about using text editors to write code.</p>
<p>You will learn how to read in files, use symbols and assignments, and iterate simple loops.</p>
<p>The course closes with discussion of data structures and subsetting.</p>
<p>Note: Those with some familiarity with programming should probably start with R Programming Introduction 2.</p>
<p><a href="https://www.statistics.com/r-programming-intro-1/#syllabus" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course14"></a>Statistics Using R</h3>
<p>In this first part of a two part course, we’ll walk through the basics of statistical thinking – starting with an interesting question. Then, we’ll learn the correct statistical tool to help answer our question of interest – using R and hands-on Labs.</p>
<p>Finally, we’ll learn how to interpret our findings and develop a meaningful conclusion</p>
<p><a href="https://www.edx.org/course/foundations-data-analysis-part-1-utaustinx-ut-7-10x#.VGdFKmf4bIU" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course15"></a>Try R</h3>
<p>Learn the R programming language for data analysis and visualization.</p>
<p>This software programming language is great for statistical computing and graphics.</p>
<p><a href="https://www.codeschool.com/courses/try-r" target="_blank" rel="noopener">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<hr />
<h3><a id="Course16"></a>Explore Statistics with R</h3>
<p>“What you’ll learn:</p>
<p>How to use R to perform basic statistical analyses</p>
<p>Why R has become the tool of choice in bioinformatics, health sciences and many other fields</p>
<p>How to use peer reviewed packages for solving problems at the frontline of health science research</p>
<p>How to make a suitable choice between a few common statistical methods, based on the type of problem and a given data set”</p>
<p><a href="https://www.edx.org/course/explore-statistics-r-kix-kiexplorx-0" target="_blank" rel="noopener" class="broken_link">Link to Course</a>   |   <a href="#Courses_Table">Back to table</a></p>
<p><strong>Do you like this list? Subscribe</strong> to the mailing list to get notified useful R resources</p>
<div id="newsArrowCenter"> </div>
<p>Please help other people to make a good decision, if you’ve taken any of these courses please leave a comment below.</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/16-courses-to-learn-r-in-2016/">16 courses to learn R in 2016</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/16-courses-to-learn-r-in-2016/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>RStudio Essentials Webinar Series</title>
		<link>https://www.masterdataanalysis.com/r/rstudio-essentials-webinar-series/</link>
					<comments>https://www.masterdataanalysis.com/r/rstudio-essentials-webinar-series/#respond</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Wed, 02 Dec 2015 13:35:58 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[R Programming]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=1169</guid>

					<description><![CDATA[<p>Have you used RStudio? If you have, you probably know this is one of the best Integrated Development Environments for R. If you haven’t used RStudio yet, check out this video: RStudio, Inc. provides open source and licensed versions of RStudio. You can check the details here. The purpose of this post was to let [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/rstudio-essentials-webinar-series/">RStudio Essentials Webinar Series</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Have you used RStudio? If you have, you probably know this is one of the best Integrated Development Environments for R.</p>
<p>If you haven’t used RStudio yet, check out this video:</p>
<p><center><iframe src="https://player.vimeo.com/video/97166163?color=428bca&amp;title=0&amp;byline=0&amp;portrait=0" width="600" height="381" frameborder="0" allowfullscreen="allowfullscreen"></iframe></center></p>
<p>RStudio, Inc. provides open source and licensed versions of RStudio. You can check the details <a href="https://www.rstudio.com/products/RStudio/">here</a>.</p>
<p>The purpose of this post was to let you know that RStudio, Inc. has created a webinar series called “RStudio Essentials”. In this series you’ll learn to get the most out of this IDE capabilities.</p>
<p>The sections are listed below:</p>
<ul>
<li>Programming Part 1 (Writing code in RStudio) – <strong>December 2nd, 2016</strong></li>
<li>Programming Part 2 (Debugging code in RStudio) – <strong>December 9th, 2016</strong></li>
<li>Programming Part 3 (Package Writing and in RStudio) – <strong>December 16th, 2016</strong></li>
<li>Managing Change Part 1 (Projects in RStudio) – <strong>January 6th, 2017</strong></li>
<li>Managing Change Part 2 (Github and RStudio) – <strong>January 20th, 2017</strong></li>
<li>Managing Change Part 3 (Package version with Packrat) – <strong>February 3rd, 2017</strong></li>
</ul>
<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><strong>Update</strong></span>: The webinars dates have passed already but you can watch the recordings here: <strong><a href="https://www.rstudio.com/resources/webinars/" target="_blank" rel="noopener">RStudio Webinars</a>. </strong>This link also contains videos about Data Science and from the RStudio Conferences.</p>
<p><strong>Please share this post so more people can benefit from these webinars!</strong></p>
<p><span style="font-size: 8pt;"><em>Disclaimer: RStudio is a trademark of RStudio, Inc. I don’t have any type of affiliations with RStudio, Inc.</em></span></p>
<p>The post <a href="https://www.masterdataanalysis.com/r/rstudio-essentials-webinar-series/">RStudio Essentials Webinar Series</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/rstudio-essentials-webinar-series/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working with files and folders in R</title>
		<link>https://www.masterdataanalysis.com/r/working-with-files-and-folders-in-r/</link>
					<comments>https://www.masterdataanalysis.com/r/working-with-files-and-folders-in-r/#respond</comments>
		
		<dc:creator><![CDATA[Orlando Mezquita]]></dc:creator>
		<pubDate>Sun, 28 Jun 2015 22:33:14 +0000</pubDate>
				<category><![CDATA[R language]]></category>
		<guid isPermaLink="false">http://www.masterdataanalysis.com/?p=495</guid>

					<description><![CDATA[<p>In this post I’ll cover how to work with files and folders in R. Working with the current directory Unless you specify it otherwise, all files will be read and saved into the working directory. Therefore, the first thing you need to know is how to get and setup your working directory. [code lang="r"] #Get [&#8230;]</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/working-with-files-and-folders-in-r/">Working with files and folders in R</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In this post I’ll cover how to work with files and folders in R.</p>
<h3><strong>Working with the current directory</strong></h3>
<p>Unless you specify it otherwise, all files will be read and saved into the working directory. Therefore, the first thing you need to know is how to get and setup your working directory.</p>
<pre>[code lang="r"]
#Get the working directory:
getwd()

#Setup the working directory:
setwd(&quot;C:/Documents and Settings/Folder name&quot;)
[/code]</pre>
<p>If you want to setup the working directory to a subfolder within your current working directory you don&#8217;t have to specify the whole path. For example, let&#8217;s say you want to set the working directory to a subfolder called &#8220;Statistical Analysis&#8221;:</p>
<pre>[code lang="r"]
#Set the working directory to a subfolder within the current working directory
setwd(paste0(getwd(), &quot;/Statistical Analysis&quot;))
[/code]</pre>
<p>Tip: If you are using RStudio you can use the shortcut <em><strong>Ctrl</strong></em> + <em><strong>Shift</strong></em> + <em><strong>H</strong></em> to browse to the desired directory.</p>
<h3>Creating a list of files and folders in a directory</h3>
<p>You might also want to create a list of all the files or folders in a directory</p>
<pre>[code lang="r"]
#list files in the workign directory
list.files()

#list files in a specific folder
list.files (path = &quot;C:/Folder/Subfolder1/Subfolder2&quot;)

#list files in a browsed folder
list.files(path = choose.dir())

#list of subfolders and files within the subfolders
list.files(recursive = TRUE)

#get the full name (path and file name) of each file
list.files(full.name = TRUE)
[/code]</pre>
<p>If you get a very long list, you can filter the results using the <em>pattern</em> argument of the <em>list.files()</em> function</p>
<pre>[code lang="r"]
#list all files that contain the word &quot;Product&quot;
list.files(pattern = &quot;Product&quot;)

#list files that end with the word &quot;csv&quot;
list.files (pattern = &quot;csv$&quot;)

#list files that start with the word &quot;Product&quot; followed by anything and ending with the word &quot;xlsx&quot;:
list.files(pattern = &quot;^Product(.*)xlsx$&quot;)
[/code]</pre>
<p>If you&#8217;re wondering what are the symbols <em>^</em>, <em>.</em>, <em>*</em>, <em>$;</em> these are called metacharacters in regular expressions. If you want to learn more about regular expressions you can watch these two videos: <a href="https://www.youtube.com/watch?v=NvHjYOilOf8" target="_blank" rel="noopener">Regular Expressions in general</a> and <a href="https://www.youtube.com/watch?v=q8SzNKib5-4" target="_blank" rel="noopener">Regular Expressions in R</a>.</p>
<div style="overflow: auto;"> </div>
<h3>Checking if a file or folder exists</h3>
<pre>[code lang="r"]
#Check if the file &quot;raw data.csv&quot; exists in the working directory
file.exists(&quot;filename.extension&quot;)

#Check if the folder &quot;Data&quot; exists in the current directory, if not creates it
ifelse(!dir.exists(&quot;Data&quot;), dir.create(&quot;Data&quot;), &quot;Folder exists already&quot;)
[/code]</pre>
<h3>Time to practice!</h3>
<p>Copy the code below and write the R code to complete the exercises in the lines highlighted</p>
<pre>[code lang="r" highlight="1, 3, 18, 19"]
# Set the working directory to any folder in your computer

# Check if the folder &quot;Raw Data&quot; exists in the working directory, if it doesn't exists create it

# Generate 25 several csv files
number_of_rows = sample(100:500, size = 25, replace = FALSE)

save_file = function(n){
    df = data.frame(Var1 = rnorm(n, 100, 3),
                     Var2 = rpois(n, 100),
                     Var3 = rcauchy(n, 100),
                     Var4 = rweibull(n, 3.5, 111.1))
    write.csv(df, file = paste0(&quot;Raw_Data (&quot;, n, &quot; rows).csv&quot;), row.names = FALSE)
}

invisible(lapply(number_of_rows, save_file))

# Merge all the csv files into a single data frame
#    Hint: Use do.call(rbind, ...) or rbind_all from the dplyr package
#
[/code]</pre>
<p>&nbsp;</p>
<p>The post <a href="https://www.masterdataanalysis.com/r/working-with-files-and-folders-in-r/">Working with files and folders in R</a> appeared first on <a href="https://www.masterdataanalysis.com">Master Data Analysis</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.masterdataanalysis.com/r/working-with-files-and-folders-in-r/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
