I am not a natural coder. I don’t think my brain is systematic enough. At university they tried in vain to teach me C, and were a bit more successful with Turbopascal. I have since had to dabble in things like GMT for plotting maps, SED and AWK for data processing (can't find a blogpost about that), R for purposes of Bacon (Bayesian age modelling software) and Matlab for multivariate statistics. And in the end I always get there (sometimes with some help), but it’s never smooth.
I now have to teach freshers R, in Welsh. And I had decided I should use that software myself. I am too stuck in my old-fashioned ways. I can do quite a lot of things in Excel, but that is not efficient. And I doubt it is the best skill to give the students. Will their future employers want that? Well actually, I suppose they do, but they will want them to be able to code as well. And then I need to be able to do it too. So now that I had to work with it for the Welsh teaching anyway, I figured I should learn it properly. And I had already stuck my nose in for the project of my master student.
Every year I take the students of my Ice and Oceans module into the field, and make them measure the directions of striations. They have to then brought these up. And so do I. And as you will have guessed, I have been doing this in Excel so far. But I wanted to learn how to do it in R. So I tried.
Rose diagram made in Excel |
Initially, I didn't get anywhere at all! You can use RStudio as a desktop app, or use it online. The problem was a bit that it seemed that my desktop app needed updates it didn't want to do, and couldn't run the commands I wondered without that update. And when I am working online I don't know where my home directory is. So I don't know how to get files in or out, and that complicates things. Especially if the packages you want to download don't seem to work. Do they end up in the wrong place? Difficult to find out if you don't know where anything goes.
At some point I asked my colleague Marianna if she could help. She was happy to. And typical enough, everything just worked when she was sitting next to me. Of course it did! So I could run the command I needed for a rose diagram. And when that was sorted, everything else was not difficult any more. I had to customise the plots, as the command assumed you are talking about wind speeds and directions, and I'm not, but I did manage to make it work for my purposes. Most of that using RStudio documentation, but also AI. I quickly found out AI doesn't know which command works with which class of object. It could still help with other things, but for combining several plots you need text written by humans!
I am not entirely there yet! I still haven't really worked out how to import and export if I am working online. I have in the meantime managed to run the same command on the desktop app, but for some reason it sometimes still refuses. Computers are supposed to be logical and consistent. I haven't worked this out yet. But I can make the whole batch of rose diagrams in one go now. That will do for now!
Rose diagram made in RStudio |
With this done I can move on to the plotting I do for other modules! I think that will be less complicated. Let's hope I'm right…
No comments:
Post a Comment