Sunday 22 November 2015

R ninja - beginnings

R is an excellent tool for analysis and management of data, it can be used instead of excel whenever you have any time consuming data-related task. I'd like to encourage everyone to use it and little by little learn how to program in R. You don't have to be a programmer or know anything about programming. I could write a script for you or help you to write it and you will see a great difference in efficiency once you start using it. With R your time in the office will be well spent (giving you an extra hour or two for coffee breaks).

Some examples:



  • Every week we get a data file where we need to add a new column with data from another worksheet. We used to use Excel and Vlookup function but once we have a designated R script, the whole task will take us only a few seconds.
  • We have 2 version of the same spreadsheet: one with comments received from the client, another one freshly run and we want to move the client's comments from the old one to the new one. Again we could use Vlookup and Excel but now we have a very simple and ready to use script in R (the script can be used with any data if only the columns have the same names and the old spreadsheet has some additional columns with comments)
  • We want to import some data from a system but we need to remove some columns, keep only some rows and save it under a different name. R can do it as well.
Using R is very easy: all you need is to open R console and paste the script text into it.

R is free and can be donwloaded here: https://www.r-project.org/

R can do everything what Excel is capable of and much more. The difference is that once an R script is written, running it will only take a few seconds (a few minutes if you have a lot of data in your spreadsheets). R is much easier to learn than VBA and is much more efficient. R is a programming language therefore you will see some code but there is nothing to worry about, R language is easier than it seems.

You will also need a code editor (although you can use word or notepad if you want) to write R scripts, NotePad++ is a good one (https://notepad-plus-plus.org), another one is Atom (https://atom.io).


You can find some very good online R courses here:

My plan is to post some code/script every week and teach you about how powerful R is and ho it can change your office life forever.