Hi!
I swear, this is probably the biggest chunk of text you will see here for some time 🐙. Let’s do it:
There are loads of R tutorials out there, I agree.
The thing is, most of them are not biology-specific, and I got a bit tired of calculating the mean number of cylinders in some old cars (mtcars package, I am looking at you 👀).
Also, biology is a beautifully messy subject, and many great tutorials which try to deal with it aren’t particularly tempting at the beginning of your R journey.
What you will see here may look very simple, almost too simple at times. But there's a method in this madness. The mini-tutorials are arranged to gradually increase your knowledge, one step at a time, without you feeling overwhelmed.
Don’t cheat. Especially on yourself.
You may think that if you just skim through the tutorial without actually executing the commands yourself, everything will be fine. It won’t be. Don’t let the simplicity of the code snippets fool you. It is important to have strong foundations. I myself learnt many of the functions I will be talking about too late during my academic journey.
You can copy and paste all the code snippets. But if you really want the information to stick, it’s better for you to just type them, letter by letter. Make mistakes. Experiment! That’s the only way you will truly learn things. Maybe even try to adapt the commands to your own needs and run them on your data.
You’ve probably met some people on your way who claimed that coding is a magical skill only few can master.
Or that a computer is a big black box ⬛ with some sort of a brain of its own. On the other side, you might have encountered people claiming that you can learn R in two weeks if you put enough effort (and money) into it.
They are all wrong, for a number of reasons, but let me just tell you that:
a) Coding is a skill like any other. You can master it only by practising. And yes, some people may pick it up quicker than others, but this shouldn't discourage you from giving it a try. You don’t have to be the best coder the world has seen so far. You only have to be good enough to achieve whatever you want to achieve, be it finishing your thesis, conducting cool research or writing a program that will rename all of your holiday pics, you name it 🏖️.
b) Computers do exactly what you tell them to do. It may not always be exactly what you want them to do, but that's the point of learning how to code — making sure that computers understand what you expect from them!
c) An intense two-week boot camp can be greatly beneficial, don’t get me wrong. Paid courses can also be awesome. But, as I said previously, there is no magic involved, so be prepared to sacrifice some time and be okay with feeling a little bit lost at times. That’s fine. Also, remember that torturing yourself with hours of coding exercises is not a sustainable way of learning how to code. Believe me, you will achieve far greater things if you don’t hate what you are doing.
I will use some exemplary datasets from my own work so that you can practice on them.
I purposefully made some of them small and manageable. I will attach a link to the dataset in every tutorial — the link will take you to the GitHub platform. If you’ve never heard about GitHub before, don’t worry. For now, let’s treat it like a place where people can upload and share their bits of code. You can get the datasets by pressing the “download the raw file” button. And no, you don’t need to have an account for that.
You can try it out here.
To understand the tutorials, you will need to have a basic understanding of R.
For example, you will have to know how to load a CSV file. Or how to assign a name ← to a variable. What a dollar sign $ denotes (pssst, it helps with accessing data from specific columns). You should have a rough idea that data frames are useful. If you are fine with that, you will do well! If these things still make you search for an emergency exit, any introductory video about R on YT will do. You can also access help with the technical aspects of installing R and RStudio in this very nice R cookbook.
Ufff, you made it!
I am done talking, see you here soon!
Aga
I want to learn more!