Menu Home

Always learning

Having spent so long within tertiary education (seriously, I started my Bachelor’s in 2011), I think it’s fair to say that I really enjoy learning new things. It can feel tedious sometimes, but I think at the core of it, I would never want to stop learning.

I mentioned in my previous post that I chose my Ph. D project, partly because I would get to expand my skill-set and learn a whole new field (e.g. Metabolomics, which in this particular instance was the study of Bacterial metabolism). So, naturally enough, even when I was looking for work after my Ph. D, I wanted to do something that would let me take some of the skills gained from said degree, but also get the opportunity to learn more stuff.

And this leads me to my past month and a half-ish, where I’ve been learning how to use this abomination coding language:

For those that aren’t familiar (those that know this would probably be recoiling a little- maybe some cat hisses), this is R, the language that many scientists and data analysts use to sift through vast amounts of data.

In its simplest form, you could use it as a calculator. Type in an equation in your script file and hit ‘run’, and the console will spit out the answer.

I can type in the command at the top (e.g. 1+2) and hit ‘Run’, and you can see at the very bottom left that the result has appeared in the console (e.g. ‘3’).

You can also use it to load data frames. For instance, this random list of passengers onboard the ill-fated voyage on the Titanic:

But hypothetically speaking, you could import and load data frames from, say, a screen of hundreds of chemical compounds to see if it could kill cancer cells, or a database that records characteristics of samples received by a lab (e.g. when it was received, where it was from, what it is, what tests it had undergone, etc).

With such vast amounts of data, extracting key bits of information (and omitting those that aren’t) could be time consuming, if done manually.

The reason why many people use this program is because you can essentially write a command that tells the program to do it automatically for you.

For instance, say I wanted to look at only female passengers over the age of 30:

I can run the command…
And here is the resulting data frame. All females, all over the age of 30. Apparently there were 101 of them.

This literally took less than 1 second to produce. It comes down to the processing power of your computer, but given I sifted through a data frame that contained 721 rows and 11 columns, that’s pretty nifty.

If I wanted to save this as a spreadsheet (to be viewed on Excel), I could do that:

Ta daa

Or, I could keep playing around with it.

How about I make a graph of all 721 passengers in this data frame?

Passenger age vs fare price paid

I could add another factor and colour code each point according to the Sex of the passengers:

And then I could just make things a little easier to interpret by adding more features to the graph…

I could even save the plot as its own individual file:

You can literally go nuts with this- the world is your oyster. This is literally just the tip of the iceberg (pun intended), and the stuff I’m actually doing for work is on another dimension.

Hopefully one day I’ll be able to write my own code more comfortably, but right now it’s sort of just at that point where I’m going, ‘I think I understood some of that?’. It really is like learning a whole new language.

For those that are also learning, there’s a bunch of resources out there for this program. I got send many links, so I’m just going to dump them below:

But lets be honest- the best way to solve an RStudio or R query is to just Google it.

Categories: Careers Ph D posts

Tagged as:


A Ph. D graduate in Microbiology, residing in Victoria, Australia. Now working part time at a secret location as a Communications and Data Officer. 👀 🦠 🧫 🧬

5 replies

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: