Publications by Marc in the box

Choosing colors visually with ‘getcolors’

18.01.2013

When plotting, I am constantly defaulting to the “main” colors in R – In other words, the colors that one can quickly call by number (1=”black”, 2=”red”, 3=”green”, 4=”blue”, … etc.) . In my opinion, these colors do not lend themselves well to compelling graphics. I imagine this is the reason for the inclusion of the much ...

1874 sym 4 img

My template for controlling publication quality figures

28.01.2013

The following is a template that I usually start with when producing figures for publication. It allows me to control:The overall size of the figure (in inches) (WIDTH, HEIGHT)The layout of figure subplots (using the layout() function) (LO)The resolution of the figure (for a .png file) (RESO)I define the overall dimensions of the figure in units...

2336 sym R (3917 sym/2 pcs) 4 img

A plea for less word clouds

25.04.2013

Word cloud of DOMA hearing transcriptsI must admit, there is something appealing about the word cloud – that is, until you try to understand what it actually means…Word clouds are pervasive – even in the science world. I was somewhat spurred to write this given the incredibly wasteful summaries of EGU General Assembly survey results that ...

2410 sym 4 img 2 tbl

A first attempt at an individual-based model in R

29.10.2013

I have been curious for a while as to how R might be used for the construction of an individually-based model (IBM), or agent-based model (ABM). In particular, what R objects lend themselves best to storing information on individuals, and allow for new individuals to be added or subtracted throughout the simulation?In this first attempt, I have e...

2337 sym R (2706 sym/1 pcs) 4 img

Working with hdf files in R – Example: Pathfinder SST data

08.11.2013

Following  a question that I posted on stackoverflow.com, I recieved the great advice to use the Bioconductor rhdf5 package to work with HDF5 files. The package is not located on CRAN, but can be sourced from the Bioconductor website: source("http://bioconductor.org/biocLite.R") biocLite("rhdf5")As an example, I use the package to extract Pathf...

1065 sym R (3187 sym/2 pcs) 2 img

New version of image.scale function

05.12.2013

Below is an updated version of the image.scale function. In the old version, one had to constantly use additional arguments to suppress axes and their labels. The new version contains the additional arguments axis.pos (1, 2, 3, or 4) for defining the side of the axis, and add.axis (TRUE or FALSE), for defining whether the axis is plotted. Based o...

1203 sym 2 img

Data mountains and streams – stacked area plots in R

09.12.2013

Below are two functions for producing stacked area plots. The first is the more typical approach where sequential series are stacked on top of another (function: plot.stacked), while the second approach is the more aesthetically-oriented version called a “stream plot” (function: plot.stream), which alternates series on either side of a meande...

1739 sym 4 img

GMT standard color palettes

25.01.2014

GMT (Generic Mapping Tools) (http://gmt.soest.hawaii.edu/) is a great mapping tool. I’m hoping to use it more in the future, but for the meantime I wanted to recreate some of the it’s standard color palettes in R. Unfortunately, I couldn’t find documentation of the precise rgb color levels used, so I ended up “stealing” them...

1010 sym R (6207 sym/2 pcs) 2 img

Importing bathymetry and coastline data in R

25.01.2014

After noticing some frustrating inaccuracies with the high-resolution world coastlines and national boundaries database found in worldHires from the package mapdata (based on CIA World Data Bank II data), I decided to look into other options. Although listed as “depreciated”, the data found in NOAAs online “Coastline Extractor” is a big s...

2706 sym R (3568 sym/2 pcs) 4 img

Decision making trees and machine learning resources for R

30.04.2014

I have recently come across Ricky Ho's blog “Pragmatic Programming Techniques”, which seems to be excellent resource for all sorts of aspects regarding data exploration and predictive modelling. The post “Six steps in data science” provides a nice overview to some of the topics covered in the blog. For some reason, this blog d...

2378 sym 4 img