### Welcome!

I am a physical oceanographer interested in how ocean water is mixed and transformed. I am a Research Scientist at the Bedford Institute of Oceanography in Halifax, Nova Scotia.

### Recent Posts:

2017-10-25 People often ask me what I like about R compared to other popular numerical analysis software commonly used in the oceanographic sciences (coughMatlabcough). Usually the first thing I say is the package system (including the strict rules for package design and documentation), and how easy it is to take advantage of work that others have contributed in a consistent and reproducible way. The second is usually about how the well-integrated the statistics and the statistical methods are in the various techniques. ...
2017-04-14 This entry is actually a re-post of a great blog I found written by Marcus Beck. It was such a great summary of the tidal analysis capabilities built in to the oce package, that I thought it would make a great addition to the (growing) library of posts here. The original post can be found here, but I’ve reproduced the Rmarkdown in its entirety here with Marcus’ permission (with a few minor format tweaks). ...
2017-04-01 I use the section-class plotting method in the oce package a lot. It’s one of the examples I really like showing to new oceanographic users of R and oce, to see the power in making quick plots from potentially very complicated data sets. A canonical example is to use the built-in data(section) dataset: library(oce) data(section) plot(section, which='temperature') Note the grey bottom profile that is automatically overlaid on the plot – the values for those points come from the individual stations in the section object, from the waterDepth metadata item in each of the stations in the section. ...
2016-12-30 This is a post written in plain Markdown (*.md) instead of R Markdown (*.Rmd). The major differences are: You cannot run any R code in a plain Markdown document, whereas in an R Markdown document, you can embed R code chunks (`{r}); A plain Markdown post is rendered through Blackfriday, and an R Markdown document is compiled by rmarkdown and Pandoc. There are many differences in syntax between Blackfriday’s Markdown and Pandoc’s Markdown. ...
2016-04-25 section objects in the oce package are a convenient way of storing a series of CTD casts together – indeed, the object name derives from the common name for such a series of casts collected from a ship during a single campaign. In it’s heart, a section object is really just a collection of ctd objects, with some other metadata. The CTD stations themselves are stored as a list of ctd objects in the @data slot, like: ...
2016-04-09 When I talk to fellow colleagues about why I use R as my language of choice for scientific data analysis, I typically point out all the advantages, and because I’m honest, the disadvantages. Typically the biggest disadvantage, especially for those coming from the java-GUI world of Matlab, is the non-interactive graphics. Now, I’ve managed to convince myself that I actually prefer making plots this way (because it forces me to script rather than noodling around with a mouse, the final plot is predictable, etc), but there are always a few things that I wish were easier. ...
2016-02-29 The most recent CRAN release of oce includes some nice new functionality for reading and converting argo objects (see http://www.argo.ucsd.edu/ for more information about the fantastic Argo float program). One question that arose out of this increased functionality was how to calculate $$N^2$$ (also known as the buoyancy or Brunt-Väisälä frequency) for such objects. Buoyancy frequency The definition of $N^2$ is: $N^2 = \frac{-g}{\rho} \frac{\partial \rho}{\partial z}$ ...
2016-02-14 In the spirit of Valentine’s day, I made a map that uses the beautifully weird bonne projection. The code uses the proj4 facilities in the oce package. library(oce) data(coastlineWorld) msg <- "HAPPY VALENTINES DAY!" msgtop <- "You mean the WORLD to me" msglon <- 130 msglat <- -30 par(mar=c(1,1,1,1)) mapPlot(coastlineWorld, col='pink', proj='+proj=bonne +lat_1=85', xlim=c(-13700000, 13700000), ylim=c(-18079625, 8008557)) mapGrid(longitude = c(-180, 180), lwd=4, col=2, latitude=NULL) text(0, 8005400, msgtop, cex=2, font=3) nc <- nchar(msg) lon <- seq(-msglon, msglon, length. ...
2016-02-11 Today we released a new version of oce, and it has been uploaded to CRAN. Only the source version is available as of the time of writing, but binary versions for all platforms should become available in the next few days. As always, the best way to install the package is to do: install.packages("oce") at an R prompt. Then you can do stuff like: library(oce) ## Loading required package: gsw ## Loading required package: testthat library(ocedata) data(levitus) data(coastlineWorld) cm <- colormap(levitus\$SSS, col=oceColorsSalinity, breaks=seq(30, 37, 0. ...
2016-02-09 Quite of bit of my work involves looking at “shifts” between two time series. There are lots of reasons why shifts are interesting, including such things as: phase differences in the tides at two different locations, physical separation between sensors on a profiling instrument, and clock drifts between two logging sensors. To accomplish the actual shifting of the vectors (I’m not going to discuss here how to determine the amount by which the series should be shifted, since that depends on the parameters of the problem), I created the following function: ...