Code

Tools and Projects

Overview
iButton Data Organizer
NetCDF Data Access
LAStools Wrapper Functions from R

Overview

I primarily use R for scientific computing, but also dabble in bash, and use SQL a fair bit for spatial stuff, working from PostgreSQL/PostGIS databases.

I’ll disclaim that I have limited formal training in coding, but have been really fortunate for opportunities to improve my skills through a few opportunities I’d encourage others to look into. First, in 2014 I attended a joint NCEAS/RENCI Open Science for Synthesis session, focused in training early career scientists useful computing tools to allow for reproducible research. This was a 3-week intensive course that covered a lot, and got me comfortable using some valuable and common tools of the trade. I’d highly recommend this to others.

Also, during my Postdoc at the University of Tulsa, I was able to engage in the emerging Software Carpentry community at Oklahoma State University. Software Carpentry (and the sibling Data Carpentry) is dedicated to teaching researchers computing skills to be more efficient and conduct reproducible research. They offer courses in a variety of tools, including Git, R, Python, Bash, and SQL, among others. Furthermore, they have a strong emphasis on pedagogy, using tried and true principles with the learners. If you are new to coding and have an opportunity, I highly recommend workshops from the Carpentries.

Below I’ve listed a few things I’ve worked on, which I hope others might find useful. My code can largely be found on two GitHub accounts; mltConsEcol is set up more for collaboration and such, and mtreg is generally for smaller, one-off types of projects.

iButton Data Organizer

iButtons are temperature and/or humidity loggers commonly used in environmental monitoring. However, using the readily-available tools, synchronizing the timing of data collection across multiple iButtons is not necessarily easy, though it’s necessary to line up timestamps for easy comparison and further analysis/processing. Thus, as part of work from my Postdoc, I put together a bunch of R code to allow for easier processing. It’s currently available as an R package via GitHub. See the package page on GitHub for installation instructions. I’m not currently using iButtons, so have not been further developing the package, but reach out with questions or post an issue via GitHub.

NetCDF Data Access

Some of the datasets I use are distributed as NetCDF files, which can be complex, involving multiple strata of data (e.g., multiple depths in the ocean) and with many time points. As of this writing, two main datasets I’ve worked with are the NY Harbor Observation and Prediction System (NYHOPS) and TopoWx (TopoWeather). Thus, you can find some code I’ve developed for accessing these data on GitHub.

Note: this will likely not work on Windows due to lacking dependencies for the ncdf4 package. I tend to set up a Linux virtual machine via VirtualBox for this work.

LAStools Wrapper Functions from R

In the past I’ve done some pre-processing of LiDAR data for the state of Oklahoma, and set up some R code to functionally script some things from R using a powerful software package, LAStools. The code is simply set up as R functions within a GitHub Repository, largely to check, and organize metadata, and correct projection information. Realizing how prevalent LiDAR data has become, I’d be happy for others to use the code as-is, if helpful, or build off of it (and if you do, please reach out to me).