Interfacing XTide and R

Edit: There is now a full-fledged R package, rtide, to accomplish the same basic task of generating time series of tide predictions that is outlined here. See this more recent post for information.

XTide is an open-source program that predicts tide heights and current speeds for hundreds of tide and current stations around the United States. It can be used to produce tide predictions in the past and future for a site at your chosen interval (down to the minute), as well as producing sunrise and sunset times, moon phases, and times when the tide level … Continue Reading

Book Review: The R Book, Second Edition (2013)

The first edition of The R Book by Michael J. Crawley was an ambitious work, but managed to be slightly rubbish due to the atrocious typographical layout of the original book. The good news is that the new 2nd edition, released in 2013, has a substantially improved layout that makes the book far more useful as a general reference. This is important, since the book is meant as an accessible reference for non-statisticians to many of the powerful data manipulation and statistical techniques available in R, particularly for biologists and researchers in similar fields. With this new edition you’re no … Continue Reading

ImageJ StartupMacros

Before I lose this file again: StartupMacros.txt This is a text file, based on the original StartupMacros.txt file that came with ImageJ, that can be dropped in the ImageJ/macros folder that is created when you install ImageJ. Start up ImageJ, and if this macro doesn’t automatically run, go to Plugins>Macros>Startup Macros to load it. It installs a few more drawing tools on the ImageJ toolbar and creates some keyboard shortcuts for the following tools:

  • Line tool – press ‘l’
  • Brush tool – press ‘b’
  • Eraser tool – press ‘e’
  • Wand tool – press ‘w’

I either found or created some code … Continue Reading

Analyzing western blots with Image Studio Lite

IS_lite_iconImage Studio Lite is a free software package from LI-COR Biosciences aimed at life scientists that want to analyze gels, western blots, dot blots, and other similar lab outputs. Although the Lite version is free, there is a more comprehensive paid version of the software that aims to easily integrate with the apparatus that Licor also sells. However, the free Image Studio Lite is more than sufficient for basic analysis of western blots, as I’ll show below.

Obviously you need to start by downloading and installing Image Studio Lite. The first time … Continue Reading

Generating polygon boundaries for plotting simple time series data with missing data

Every so often I want to plot some data with pretty upper and lower error bounds, such as temperature data through time, perhaps with the maximum and minimum temperature range or standard error bounds for averaged data. The polygon( ) function can make those sorts of pretty plots. However, I’ll often have chunks of missing data for periods of time, so I have to break up the polygons that go with the plotted data. I could swear I wrote a function to do this several months ago, but it’s lost in a pile of other scripts, so I re-wrote a … Continue Reading

Adventures in kludgy software – Diving PAM edition

As a general rule, expensive pieces of lab equipment must come with software of questionable quality. In this case, I just want the raw data off a $20,000 submersible DIVING-PAM fluorometer, which can be used for measuring the photosynthetic yield of algae and plants out in the field, away from a computer. But downloading the data requires a mini-odyssey through some needlessly confusing software that comes with the unit.

To start with, the packaged instruction manual for our DIVING-PAM still references a DOS-era utility for downloading the data, because the (brand new, delivered in 2012) instruction manual was printed in 1998. … Continue Reading

Waterproofing iButtons, and reading waterproofed iButtons

iButton temperature dataloggers are tiny, long-lived temperature sensors that are great for all kinds of environmental and biological monitoring, but they’re a long ways from waterproof. Old farts will regale you with tales of a bygone era when you could leave a bare iButton submerged in seawater for months at a time without problems, but those days are long gone, due to a re-design in the early 2000’s. Nowadays you can’t even get away with leaving them in moist soil without eventual water intrusion, component failure, and data loss. But given their tiny size and relatively low price … Continue Reading

The new definitive guide for setting up Eclipse, StatET, and R on Windows 7

Quite a while back I wrote some tutorials on getting the StatET plugin for Eclipse running, so that you can write R code and run it within the Eclipse development environment. The developers of all of these pieces of software have kept marching on with the development process, so my walk-throughs are getting a little stale. Luckily, Catherine Dalzell has stepped in with an updated tutorial for getting the most recent versions up and running on Windows 7. See her blog post and the full-fledged pdf … Continue Reading

Have some squid

You might be forgiven for thinking that the ocean is an endless bounty of edible goodies when you walk outside and find squid just strewn everywhere on the beach, waiting for you to pick them up and eat them. This happened the other day at work, when a group of juvenile Humboldt squid (Dosidicus gigas) decided to sun themselves on the beach. And then they died. And some seabirds got a good meal out of it. Enjoy some pictures and video.

Squid galore.

Continue Reading

Adding p values and R squared values to a plot using expression()

I was fooling around with including a p-value and R2 value on a plot I was putting together, and found myself quickly descending into the world of R graphics esoterica. I wanted to be able to include the values on the fly using values extracted from a linear model summary object, and I wanted to use the proper italics and superscripts for the text. The desired output is shown below. What follows is how I finally generated the plot.

The goal, include the p-value and adjusted R-squared … Continue Reading

Page 6 of 11« First...45678...Last »