# R for scientists!

R is a free, open source programming language designed for statistical analysis and graphics. Its core user base has long been statisticians and data miners, but is rapidly gaining popularity in increasingly diverse areas. I started actively learning and using the language in early 2015, and it has completely taken over my approach to analysis of data. In fact, I’m such a fan that I intend to devote a small corner of my website to showcasing its usefulness for scientists like me.

## Why use R?

• It’s free, and cross-platform. The latter was a big selling point for me. Previously, I had always used the proprietary software Origin for data analysis and plotting, but since it’s Windows only, that meant using Parallels, and institutional licensing makes working from anywhere but the office difficult. Being free is also a good advantage over, say, MATLAB.
• Good community support. When learning R initially, finding out how to do something was as simple as using Google, and when that doesn’t work, a question on StackOverflow usually gets answered fast.
• Good plotting capabilities out of the box. Especially with ggplot2, the graphics are good quality from the start, logical in the way that they’re built up (once you understand the logic, anyway) and easy to customise to personal preference.
• Automate routine analyses. This is useful to me as a battery scientist routinely testing cells using the same instruments and the same, or at least similar, techniques. R makes it easy to write a script to handle specific data processing and plotting, shortening tasks which once might have taken several minutes or even considerably longer down to mere seconds.
• Keep track of analyses. Writing a script is a useful way of keeping track of all the steps between raw data and analysed data, and makes it quite simple to track down and correct any mistakes quickly.
• It’s really powerful! I keep finding new things I can do with it, things which give me new ideas for research every day. I don’t think I’m going to be running out of uses for it any time soon.

If I had to list any disadvantages, I would say that even though I think R is easy to learn, it is not always intuitive, and the official documentation is often hard to understand for less familiar users – I at least find it far easier to pick apart an example to find out how something works.

## What do I use R for?

I use R extensively for data analysis, but also for visualisation/communication purposes. Examples are included on this website.

## R packages

• arbintools – a package for data importation, analysis and plotting for users of Arbin battery cycling instruments

## Tips, and neat things

Here I hope to share some R tips based on things that I’ve found very useful. I hope that others will find them useful too! One thing I would thoroughly recommend, however – get RStudio, which is a free IDE for R and makes using it much easier!