Blog Archives

Importing bathymetry and coastline data in R

January 25, 2014
By
Importing bathymetry and coastline data in R

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 step forward. There...

Read more »

GMT standard color palettes

January 25, 2014
By
GMT standard color palettes

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 documen...

Read more »

Data mountains and streams – stacked area plots in R

December 9, 2013
By
Data mountains and streams – stacked area plots in R

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...

Read more »

New version of image.scale function

December 5, 2013
By
New version of image.scale function

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 s...

Read more »

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

November 8, 2013
By
Working with hdf files in R – Example: Pathfinder SST data

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") Created by Pretty...

Read more »

A first attempt at an individual-based model in R

October 29, 2013
By
A first attempt at an individual-based model in R

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...

Read more »

A plea for less word clouds

April 25, 2013
By
A plea for less word clouds

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 wri...

Read more »

A plea for less word clouds

April 25, 2013
By
A plea for less word clouds

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...

Read more »

My template for controlling publication quality figures

January 28, 2013
By
My template for controlling publication quality figures

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 resoluti...

Read more »

My template for controlling publication quality figures

January 28, 2013
By
My template for controlling publication quality figures

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...

Read more »