Learning R

My experience learning how to code

Posted by Danny Schnitzler on January 09, 2021 · 4 mins read

Right, before you read this, I should be clear: this is not about pieces of code, statistics, or anything technical.

When I was a uni, the most we got by way of stats was one lecture giving us the basics. All these basics could be done either using excel or GraphPad Prism. Prism is a wonderfully user-friendly programme, where you input your data, click a few buttons and you’re done. You get a graph and p-values. No idea what was going on under the hood and no way to check.

I used it for years.

Not because I was being lazy, but because I just didn’t know any better. I had heard of R before and thought it was something I ought to learn, especially now that undergraduates are learning to use it as part of their degrees.

I signed up for an intensive three-day R course. I followed along, did the exercises in the booklet and felt like I was getting it. Then I went home and tried to apply my own data to what I had learned and instantly gave up. What I was doing was far more complex than the simple examples we had been given.

I tried again a couple of times using online resources, but every time I just got frustrated because I didn’t understand how to apply anything to my data! I was overwhelmed by the new language and didn’t know what I could do with it. Over time, I even forgot how to load my data into R.

Over the summer, I had a zoom call with a statistician about something else. He said I should really learn R and that I should try again. So I did. He sent me a basic script to run using my own data and I started understanding it.

On my own, I took the whole thing apart and learned how things work. I then started putting it back together, adding more and more pieces of my own, until I got a script that did everything for me. It was really hard work and I worked on it Monday to Sunday, 9am to 11pm for two solid weeks. At any given point I had about 30 Chrome tabs open looking for pieces of code and guidance. Stack Overflow essentially became my homepage. In the end, I had created a long and complicated script that I had written by myself. I was so proud of myself.

Do I know everything R can do now? Hell no! Do I still get stuck? Hell yes! But I have learned the right way to search for questions, to read docs, and to ask for help. I mentioned Stack Overflow, which has really been a life-saver. Because most R users are self-taught, the R community online is pretty friendly and helpful. Asking stupid questions is okay, because people will help you understand and learn.

If you are just starting to learn R or are at a loss of where to start, I would really recommend finding someone to help you with your data. You will be learning using your own data and learning the pieces that will help you. It gives it context. You know what you are trying to do, so you will understand the outcome.

Good luck on your own R journey!