A little while ago (while avoiding my thesis), I wrote a small R package for the calculation of the optical response of multilayer thin films. It's called mlfilms and is avaliable on github. As a quick example, here is how you'd calculate and plot the reflection from a thin silver film through a prism. This … Continue reading The calculation of the optical response of multilayer thin films

# Category: R

Posts dealing with R code

# Non-rectangular colourplots

When I started using R, one of the first things I wanted to do is make reliable colourplots. Colourplots are a way of representing 3D data as a 2D image, with the x and y coordinates representing variables and the z values represented as a colour. For simple colorplots, the image() function from the base … Continue reading Non-rectangular colourplots

# Smartening up plots with ggplot

R is a wonderfully powerful tool for the production of publication-quality figures. The power of R to make these plots comes at a cost: with absolutley everything customizable the learning curve is steep, and the defaults can be ugly. Lets take a look at a default plot. x <- seq(0, 2 * pi, , 100) … Continue reading Smartening up plots with ggplot

# Thesis Diagrams

So, I'm writing my thesis at the moment, and invested some good procrastinating efforts to make sure my diagrams are consistent with my LaTeX thesis template. What I've learnt could be useful, so here it is; Graphs I do almost all of my data analysis using the fantastic (and free) R statistical package with RStudio. … Continue reading Thesis Diagrams