I hate R!

R
RStudio
Author

Burak Demirtas

Published

April 2, 2023

“My friend recently exclaimed, ‘I really hate R,’ and a quick Google search showed me that many others feel the same way.

I want to quote from an interesting post in reddit which I hear similar voices from many others around me who are in this journey:

I am in my second year of grad school and started learning R last year. People keep telling me that it’s oh so wonderful, and I recognize that it’s capable of a great deal, but I absolutely loathe R.

Recently, I was able to cycle through various inputs for a simulation without for loops, but that was after many, many hours on stack exchange testing random bits of code until I finally got it to work through brute force using several lines of redundant code.

I’m always putting function arguments out of order, misplacing commas, omitting parentheses, etc., and constantly have to refer back to previous scripts from which I copy/paste bits of code. The only things I can do automatically all involve the GUI of R Studio, no coding.

At the pace I’m “learning” R, I’m starting to think I will never be proficient in the language.

Has anyone else reached a point where they feel comfortable with R (or at least not on the verge of taking a hammer to the keyboard)? What did it take to get there?

I thought about posting this to r/statistics or something, but this is as much about motivation as it is about anything else.

Why do significant amount of people feel so stuck and frustrated during their R learning journey?

I think it’s something worth to think and discuss!

Why

Reason 1: Lack of Programming Basics

Unlike learning Java or C++, which typically start with the basics of programming concepts, syntax, and code organization, learning R may lack emphasis on these fundamentals. As R is often used by statisticians, academics, and non-coders, the underlying programming concepts may not be thoroughly taught, with a focus on providing ready-made scripts and explanations without delving into the fundamentals. This causes tons of problems! This is the point where most people just copy pasting and modifying without really understanding what’s going on behind.

Reason 2: Lack of Statistics Basics

R was made for statistics! If you even don’t know what a histogram, a box plot or if you never heard of a “normal distribution”, you are trying to run without knowing how to walk.

Reason 3: Skipping “Not understood” Parts

This is one of the biggest mistakes you can ever do when you do some programming including R.

The story of Toyota’s early days in car production is often cited as an example of their unique approach. Initially, they would stop the assembly line almost 90% of the time, which may seem counterintuitive as every stoppage results in lost money in a production line. However, the reason behind this approach was their strict rule of “stop the line if there is a problem.” Instead of ignoring or glossing over issues, they would rush to the problem area, engage in quick brainstorming, define actions, and then proceed. As the story goes, they never skipped any problem or swept issues under the carpet, and as a result, they achieved an impressive 98% “First Time Through” rate within just one year. Solid basis, going with little steps but with a clean page is always better than a fuzzy information junk.

If you keep skipping “not understood” things over and over, they will turn to a mountain of chaos and all will seem like alien language.

Reason 4: Not asking help!

I’m giving a free support to students in many sessions in a week in my university and only few students show up to sessions for questions. If you have some people in your reach and if you don’t ask enough questions, sorry but, you can’t blame others, this one is totally on you. 🤷‍♂️

Reason 5: Not seeing the FUN part!

There could be also other causes but I think this is the worst part. Believe it or not, coding is actually FUN if you can get yourself to a mindset like “I’m actually creating something!” Especially when you go beyond what you have been told and try new things. When you see you actually created something on your own, in your own way, then you are going to feel that satisfaction. Yet, most people who learn R, just learn it with painful methods and loose the bright side of it.

How & What

You can consider the following suggestions:

Emphasize Fundamentals: When learning R, start with the fundamentals of programming, such as understanding objects, data types, syntax, and code organization. Don’t skip over these basics, building a strong foundation will help you better understand and use R. For example, learn how to create your own functions first to understand how functions work. Also, watch videos about what is object oriented programming and what are the fundamentals of it.

Learning Resources: Be picky when you choose your learning source! If there is a source which doesn’t tell you the basics, or if it’s not structured and going one by one, don’t go with that source.

Practice and Experiment Coding: Just like with any programming language, practice is key. Write code, experiment with different functions, and work on real-world projects to apply what you’ve learned. The more you practice, the better you’ll become at using R. If you only stick with what you are given, you can be sure that you are never going to be proficient!

Learn Some Statistics: Whenever a new statistics term you encounter in R, just go to youtube and watch a 3-5 mins video about it. Believe me, %80 of the time, you will understand by just watching once!

Be Careful with Chat GPT: Chat GPT can give you some solutions but it’s not giving them as a human would do. Also, in many cases, it fails to give a running code even when your case is a little bit complex. It can remind you the syntax or give some insights but you need to be aware of each piece of code which you implement to your scripts.

Don’t Be Afraid to Ask Questions: If you’re struggling with understanding a concept or a specific script in R, don’t be afraid to ask questions. Reach out to your peers, instructors, or online communities for help. Clarifying your doubts early on can prevent misunderstandings and make the learning process smoother.

Try to Get some FUN! 🥳: Change the variable names with funny things, try to write a funny “where loop” which will keep asking “how do you feel” until you say “amazing!”. Create a basic shiny app with the help of chat GPT, and play with the parameters just to show yourself that you can actually do these things!

At least, these my opinions about the topic. Just put your comments also below and let’s discuss about it more! Also one clarification: I really like R! 🤗