Robin's Blog

Archive for the ‘Programming’ Category

My LaTeX preamble

Since I started my PhD I have forced myself to use LaTeX for all of the documents that I write (yes, absolutely everything), and this has really helped me get to grips with how to do things in LaTeX. Overall I have been very impressed – my documents now look really professional, and LaTeX actually […]

Git helps me get round to using source control

I’ve always heard how source control should be used for every project, including those which you think are just going to be throwaway code. However, I’ve often not got around to doing this – if I write a piece of code in ten minutes, but it takes five minutes to set up a new subversion […]

Want to write some code? Get away from your computer!

I’ve recently realised something. The best place to write code isn’t in front of your computer, with your compiler, IDE and tools. The best place to write code is far, far away from any of these tools – somewhere where you can think properly. For a language with which you are fairly familiar, the mechanics […]

Review: R Graphs Cookbook by Hrishi Mittal

Summary: Very useful for reference while producing graphs, and very comprehensive (including heat-maps, 3D graphs and maps). Reference: Mittal, H. V., 2011, R Graph Cookbook, Packt Publishing, Birmingham, UK, 272 pages, Publisher’s Website As a scientist I often need to plot graphs of my data, so I am keen to learn more about how to […]

Review: Python Geospatial Development by Erik Westra

Summary: Great book – both for GIS concepts and for teaching Python libraries. Lives up to the boast on the front cover – you really will learn to create complete mapping applications, learning a lot of useful tools and techniques on the way. Reference: Westra, E., 2010, Python Geospatial Development, Packt Publishing, Birmingham, UK, 508 […]

Git + DTerm = Great Source Control in OS X

Git is my favourite version control system (see Why is Git better than X for some good comparisons with other tools, and my GitHub repositories to see what I’ve been doing with it lately). I now use it for all of my programming projects, and many of my writing projects (as I’m now using LaTeX […]

Review: R in a Nutshell by Joseph Adler

Summary: Very comprehensive and very useful, but not good for a beginner. Great book though – definitely has a place on my bookshelf. Reference: Adler, J., 2010, R in a Nutshell, O’Reilly, Sebastopol, CA, 611 pagesO’Reilly Link After reviewing a book about R designed for beginners (see my previous post) I thought I’d step up […]

Review: Statistical Analysis with R: Beginner’s Guide by John M. Quick

Summary: If you can get past the strange underlying story, then this gives a good introduction to R to someone with no programming experience. However, if you have any experience with other programming languages then another book is likely to be more suitable. Reference: Quick, J. M., Statistical Analysis in R: Beginners Guide, Packt Publishing, […]

Producing grids of plots in R with ggplot2: A journey of discovery

I’ve just gone through a bit of a ‘journey of discovery’ in R while trying to plot a grid of plots for one of the research projects I’m doing. I wanted to write a simple function which could produce this grid of plots from a CSV file, allowing me to easily view the trends of […]

How to: Find closest objects in ArcGIS with Python

As part of my DunesGIS project I had a need to calculate ‘closeness statistics’ for objects in ArcGIS. By ‘closeness statistics’ I mean statistics giving information about how close the objects are to each other. I needed to do this to calculate how dune patterns change over time. The code below takes a shapefile as […]