kareina: (BSE garnet)
Some time back [livejournal.com profile] phialastring had a post wherein she sang the praises of the R project for statistical computing, and described how she had used it to make it easy to do something textile related (patterns for something, perhaps weaving? I don't recall). At the time I hadn't tried using the program, so while it sounded interesting, I did not ask her for copies of her work.

Some amount of time later I started my job here at LTU, and discovered that the program that I used to use to plot my geochemical data isn't available on the uni network here. So I asked around to find out what people in the department are using instead, and got several different suggestions. One of them, GCD-kit, is an expansion for R. Therefore, recalling that [livejournal.com profile] phialastring strongly recommended R for both science and art projects, I decided to go with that.

It took a bit of help from a colleague to figure out how to set up my data files to work with the program, but once that was accomplished I soon learned, on my own, how to use the drop-down menus to create graphs of my data, and how to re-size them when needed. The program gives one two options when using the drop down menu to create a graph--one can either type the variable name, or one can hit "enter", and a new window appears with a list of all of the variables in your data set for you to click on one of them. Because life is prone to typos, I soon developed the habit of using the clickable option.

Last week, after weeks of waiting, I finally received the data from the analyses of the first batch of samples I collected, and so I begun playing with it, and making graphs to see how it all looks. Yesterday I decided that I should compare my data with the data from a Master's student who worked in the same region last year, so I created a CorelDraw file in which I started tracing some of the figures from his thesis so that I could superimpose those tracings (showing boundaries between the different rock types shown on each graph) over my own data and thus get an idea of how the two datasets compare.

This morning I continued work on this project, and got far enough along that I decided to start colour-coding my data to show which samples happen to fall into his curves for various rock types, and which ones fall outside of his curves (note that some samples fall well into a specific rock type for one graph, but well outside of it for another!). However, every time I changed the colours for a sample in a spreadsheet it was necessary to go back and use those drop down menus to recreate the graph with the new colour scheme applied. While it doesn't take that long, it still takes time, and it was getting frustrating.

So rather than just being annoyed I decided to do something about it, and went looking for advice on line on using R, and eventually taught myself how to make a simple script that creates each graph, with the scale set to the exact same values as those shown in his thesis (changing the end points to match was also taking too much time). Now that the script exists I can create all eight graphs with the push of a single button. If I change anything in the data set (like what colour the andesite rocks should plot, or what symbol for those samples which still have feldspar in their thin sections) I can re-create all of the graphs with a single push of the button.

This makes me happy. Yes, it took me a few hours to figure out how to do this, and get it set up properly to work, but now it is done. I will need to do this task again when I get the second batch of my data, and I should also go back and apply this to all of the old data from analyses the company did before I started the job. I will also be able to use this text file as a base to edit and set up any number of other graphs, any time I want.

I love good tools and learning how to operate them properly. I know that I have barely scratched the surface of what this program can do, but now that my toes are wet I may not hesitate to wade in a bit deeper next time I need to do something with my data.

Profile

kareina: (Default)
kareina

May 2025

S M T W T F S
     123
45678 910
11121314151617
1819 2021222324
25262728293031

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags