Posts

Holy simple features and leaflet!

My mind has just been blown. I have been drinking Hadley’s tidyverse Kool-aid for a couple of years now. I’m just wrapping up a seminar in UCSC’s Ecology and Evolutionary Biology Department on reproducible research. One thing that ecologists always want to do is make nice maps of their study sites. Further, spatial data is now a lot easier to come by and can provide a lot of meaninful inference.

Working in Windows, minimally

I used to have a virtual Windows machine set up on my Mac laptop and I would use that for compiling programs up for Windows, and testing things on the Windows side. That laptop was replaced, so I had to set up a new environment for cross compiling. My goal in this is to have to deal with Windows as little as possible, and, when I am in the Windows environment, try to use tools that are familiar (i.

Convert Genepop to two-column format

People here at the SWFSC have started using stacks to process ddRad data. They can output data from stacks in genepop format, and sometimes the want to convert that into the format that is useful for slg_pipe. I would typically have done that sort of thing using sed and awk, but I thought I would give a whirl at doing it in R. Below is a function I wrote for Martha.

Solving ODEs in R

Marc Mangel is offering a course in Quantitative Fisheries at NMFS’ Southwest Fisheries Science Center (where I work). Having spent the fall delivering a course about using R to my NMFS colleagues, I thought it would be fun to sit in on Marc’s class. What a great opportunity! I just think it is the coolest thing that Marc is part of our community, and is willing to provide this enjoyable and useful education for us!

Plotting SST with ggplot

Roy M and I were curious about how one might go about efficiently and quickly plotting big rasters like sea surface temperature data using ggplot with nice coastlines in there, etc. I had considered using ggmap. For reasons to do with the mercator projection of the base map in ggmap the word on the street is that this doesn’t work very well. I regularly crashed my whole R session trying it, too!

Accessing MS SQLserver with R from my Mac

A few years back I had used unixODBC and freeTDS to be able to connect from my Mac to the Microsoft SQLserver that is here in the lab. Since then I have switched computers and upgraded operating systems, etc., and need to redo it. My goal here is to be able to use the RODBC package to slurp data from the SQL tables into R. I have a whole collection of notes from the last time I did this.

Comparing Map Resolutions

I am curious about how the resolutions of shorelines differ between different map sources. Roy M just pointed me to NOAA’s GSHHS shoreline maps (they also have boundaries and rivers). I am curious how that compares to the worldHires map available in mapdata. I downloaded the 113 Mb “bin” version that was at http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhg/latest/gshhg-bin-2.3.3.zip. I put the resulting directory inside a directory called Maps in my home directory. Load all the libraries we will use: