How difficult is it to learn to use R?
In my case, I found learning R to be a rather natural and enjoyable experience. While it is true that I had previous coding experience, the R environment’s lack of code compilation and ecosystem was very intuitive to me.
You can immediately see any declared functions and variables. You run everything line by line like Python. There is no need to run an entire file to test one line of new code. So, while you will often read that R is difficult to learn, I don’t agree.
The R programming language is intuitive and easy to learn. Following a simple guide will allow you to perform some data analysis within a single afternoon. Having previous coding experience is helpful, but not required. The R programming language doesn’t require explicit variable declarations or compilation so it is accessible even to beginners.
I remember being able to run a linear regression and make a plot in the first couple of hours of trying R.
How long will it take to learn R
You can begin using R in a productive way in a single afternoon.
Begin by simply reading in data, running simple statistics such as linear regression or simple coefficients, and saving your results to a CSV file. An absolute beginner can follow an online guide and achieve this in just a couple of hours.
An absolute beginner can learn to do basic data analysis work in just a day or two with the R programming language. More complex tasks, such as data cleansing, can take more time to understand as it relies on some core programming knowledge like data types and control flow statements. Spending 5 dedicated hours a week should get a beginner user proficient in R in just 2-4 months.
If you already understand some coding principles, this would definitely accelerate your timeline. I was proficiently using R after just 2 months during my graduate studies. Although, I had professional instruction, a coding background, and was highly motivated to learn.
Why is it Hard? What type of programming is R used for?
Some programming languages are better suited for different things while other languages are more general. For example, Python and C++ are general languages that can really do almost anything while HTML and SQL have very specific purposes.
R isn’t the most general language, but it isn’t as narrow in its use case as SQL.
Largely R is used for data analytics and data science. There are packages, such as RShiny, to create simple websites with R, but there are other languages much better suited for web applications. Due to the relatively easy learning curve and well-supported libraries for data work, R is a popular tool for scientists and data analysts.
That being said, I have created web apps with RShiny and used R to automate report generation before. You can do almost anything with R, but it might be a bit trickier than using another programming language.
Factors that will speed up learning R
There are some factors that will speed up the process of learning the R coding languages. Let’s go over the list.
Prior Coding Experience
This is a no-brainer.
Knowing the basic principles of programming such as data types, flow control statements (if-statements, for-loops, etc), and the concept of functions and parameters will greatly speed up the learning process. Having prior coding experience is probably the biggest factor in the time it takes to learn the R programming language.
A complete beginner will have many fundamental concepts to learn before they can properly troubleshoot and write complex code. These concepts will take weeks to months to really cement themselves in a beginner’s memory.
Amount of Time Spent Learning
You will learn a programming language or any skill at a rate proportional to the amount of hours per week you spend learning it.
This applies to language, programming, sports… you name it.
If you study R for one hour a week, it could take you a year or more before you are competent enough to really take your first job. If you study R an hour a day, then accelerate that progress to about 8-12 weeks before you could take your first simple job.
So what is realistic for you? Can you study and dedicate an hour of focused time a day? How about two hours?
Professional Instruction
It is easier to learn a skill when you have a professional instructor guiding you along the way. Preferably a human and not just an online course, although some online courses can be very instructive.
The downside here is that a professional teacher can be expensive and some people don’t have the budget to pay for a one-on-one tutor or to sign up for a course. Many of the online courses you see aren’t very good anyway.
I learned R first through a graduate university course, so I’m not going to make any immediate suggestions for an online course here just yet. There are however a plethora of fantastic online resources/courses that you can use to teach yourself. For example, Kahn Academy is a great example of a free resource to use.
Logical Thinking Skills
You can’t fix stupid.
-Somebody Wise
Beyond the horizon of the endless sky of syntax, frameworks, and object types, all of programming boils down to logical thinking.
At a basic level, there are best practices and implementation can be very black-and-white. Yet, with any project of enough complexity, there will be countless ways to implement and achieve what you are trying to achieve. Whether you are coding a web app or performing complex analysis, this holds true.
Believe it or not, you can train yourself to think more logically. If you want to train yourself, then I would recommend learning and working through math problems and particularly applied math such as physics or simple engineering problems. It may not seem related, but they are probably the best logic and reasoning training you can do.
Learning R without a programming background
Best Learning Tools to Learn R
Nothing will force you to improve your skills like real-life work experience. Yet, before you can get started using R for a paycheck, you will need to have a base level of skills.
So what resources are available for you to learn from? The list I have below will focus only on FREE R learning resources.
Please note that this list is incomplete and there are PLENTY of other great resources out there.
R for Data Science: Data Visualization Chapter
R for Data Science is arguably THE textbook to learn from if you want to apply R to large datasets. It covers all of the basics with useful examples and clear explanations. I think of it more as extended documentation and that attests to how useful I think it is.
You don’t need to read the whole textbook, but it would give you a strong foundation if you did. Hadley Wickham, the creator of the Tidyverse, wrote this gem.
Official Tidyverse Tutorial
Tidyverse is a subset of libraries and functions within R that were created specifically for Data Science and to improve upon some the base R functionality. You need to familiarize yourself with tibbles and Tidyverse syntax at some point or it will come back to haunt you.
This 5 step tutorial that teaches you to use the Tidyverse packages and train and test a simple model is a fantastic and free tutorial to get started with.
Learn about RMarkdown
Analyzing data and creating models is great, but that’s only half of the job. The other half will be presenting and explaining your results in a way that people understand.
In comes RMarkdown. This Latex-based report compiler will have you automatically generating beautiful reports in no time. Check out the official documentation and primer on RMarkdown for free.
R-Cheatsheets
These are quick, summary cards that show you have to apply the basic functions for different areas of R. These are great and extremely useful even for someone experienced with R programming.
Conclusion
Thanks for reading and look out for more content from RTL Coding. Hope this article was useful and if you would like to support this blog and this content feel free to donate via Paypal to help support more helpful content.
Sources
- MySQL SQL Dump Options and Examples Documentation
- Amazon Web Service (AWS) SQL Dump Docs
- Microsoft Azure SQL Dump Docs