Tag: R-project
-
Accessing NOAA tide data with R (updated 2021)
It’s been a decade since I wrote a script to retrieve observed tide height data from NOAA’s CO-OPS server, which lets you grab up to a month of tide data for a given tide station at a time. In that time, they’ve migrated over to a new server and slightly different API, so it’s probably…
-
R as.Date() and time zones
Here’s a fun quirk to watch out for when playing around in R with POSIX time values and converting them to dates. I’ll start by creating a time variable, in the POSIXct class, and set it to use my current time zone, which is Pacific Daylight Time (PST8PDT). If I then wanted to turn this…
-
rtide: a R package for predicting tide heights (US locations only currently)
Joe Thorley at Poisson Consulting has released a new R package, rtide, (on which I am listed as a co-author) that provides the ability to predict future (and past) tide heights for 637 different tide stations in the United States and associated territories. The underlying data, consisting of tide harmonic constituents, are collected and released…
-
A plot of co-authorships in my little corner of science
Here’s a mostly useless visualization of the collection of journal articles that sits in my reference database in Endnote. I deal mostly in marine biology, physiology, biomechanics, and climate change papers, with a few molecular/genetics papers thrown in here and there. The database has 3325 entries, 2 of which have ambiguous publication years and…
-
Extracting NOAA sea surface temperatures with ncdf4
I’ve written previously about some example R scripts I created to extract sea surface temperature data from NOAA’s Optimum Interpolated Sea Surface Temperature products. If you want daily global sea surface temperatures on a 0.25×0.25° grid, they gather those into 1-year files available at http://www.esrl.noaa.gov/psd/data/gridded/data.noaa.oisst.v2.highres.html. If you want weekly average SST values on a 1×1°…
-
Make your R figures legible in Powerpoint/Keynote presentations
Having just returned from the SICB 2014 meetings, the appearance of many people’s Powerpoint figures is fresh on my mind. The sheer number of tiny figure labels (tick marks, axis titles, legend text etc) is disappointing. If we want to point fingers, MATLAB users are clearly the worst offenders because of the microscopic default label…
-
More tide prediction with 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. In the previous post I outlined how to query the XTide software with R and parse the results into a handy-dandy data…
-
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…
-
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…
-
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…