How to start programming in R
- select the contributor at the end of the page -
The R programming language has become very popular in recent years. It’s used for working with data and its interactive programming capabilities, powerful statistical analysis tools and data visualization capabilities have made it the first choice among many data scientists, data analysts and programmers.
What exactly is R?
R is both a programming language and an environment. This means that it provides us with both a language that we can use to write our code and a development environment within which we can write that code. R provides methods for both numerical and graphical data analysis, making it possible for us to work with data both numerically (e.g. calculating descriptive statistics) and graphically (e.g. creating data visualizations).
Additionally, R was designed to make it simple to transform and manipulate data. It has several feature and extension packages that make it a highly valuable tool for completing a variety of data management tasks including importing, transforming, cleaning and exporting data using a wide variety of data formats. What’s more, R is actively under development with new extension packages being created almost daily. It has a large and active user community, and is very modular and extensible—in fact, there are currently over 6,700 extension packages for R.
Best of all, R is free open-source software, meaning anyone can use it without cost. This also means you can view the source code, learn from it, modify it or redistribute it under the GNU General Public License.
Why should you learn R?
In an information economy, data is the new oil. However, in the same way we must transform crude oil into fuel, we must also be able to transform our raw data into actionable insights to provide us with value.
We now have essentially free and nearly ubiquitous data at our disposal, and the amount of data we capture and create is growing exponentially each year. But the complementary scare factor in our data-driven economy are individuals with the skills and tools to make sense of this sea of big data. Several industry sources, such as Dice, O’Reilly and Bloomberg, all indicate that data science skills—like data analysis with R—are in high demand.
It should come as no surprise that this demand and corresponding shortage of talent is commanding significantly higher salaries than market averages for IT professionals. Essentially, if you have a desire to learn how to transform data into actionable insight, R is likely the right tool for the job. Ultimately, it’s a great asset for your data-science tool belt and an excellent skill to increase your value as an IT professional.
5 steps to learning R
Here’s some good news: There are numerous resources available for learning R. The best plan largely depends on your access to these resources, the amount of time you have available and your specific learning style. In any case, these five steps can help you get started with a general learning plan.
1. Head over to the R website and download a free copy of R. This way you have it installed on your computer as soon as you’re ready to start. It’s free to download, install and use—and it’s relatively easy to get up and running.
2. Download a copy of either RStudio or R Tools for Visual Studio (RTVS). RStudio provides you with a powerful and easy to use Integrated Development Environment (IDE) for working with R. RTVS provides you with similar power and ease-of-use if you already use Visual Studio as your day-to-day IDE.
3. Watch online tutorials and courses to learn the basics of R. Pluralsight has several courses on R including my Exploratory Data Analysis with R and Beginning Data Visualization with R courses that will provide you with the core information you’ll need to become proficient in R. Johns Hopkins University also provides a full Data Science specialization through Coursera that teaches data science topics using R.
4. Once you feel comfortable with the basics of data transformation, data analysis and data visualization with R, you’ll likely need to find resources for more specialized tasks. There are several online resources including Revolution Analytics, RBloggers and Flowing Data that provide excellent tools to help you move beyond the basics.
5. Finally, the only way become an expert in R is to start using it in practice each day. I recommend starting with simple data manipulation, data analysis or data visualization tasks that you would typically complete with a spreadsheet or other programming languages. Then continue to gradually work on more complex real-world problems until you become as proficient with R as you are with your current tools. Then make the transition to using R for all your day-to-day data-related tasks.
In order to succeed, our information economy depends on both large volumes of data and talented individuals. If you equip yourself with the skills and tools necessary to function in this new data-driven economy, you’ll be ahead of the game. So go ahead and set aside some time to learn R, and before you know it you’ll be transforming data into actionable insight.