R

Using the latest GDAL with R packages on macOS - redux

As an update to an earlier post, here’s how to use the latest versions of GDAL/PROJ with R spatial packages. Install GDAL brew install pkg-config brew install gdal (Re)install R spatial packages Next, we need to install a few packages from source in order to use the new GDAL libraries: ## (re)install spatial packages from source install.packages(c("rgeos", "sf", "sp"), type = "source") ## rgdal requires some additional configuration to build correctly: ## based on http://stackoverflow.

Yes, The Queen is listed as an 'author' on our R packages

A number of people have been surprised to learn that Her Majesty the Queen is listed as an author on a number of our packages. For example, in the SpaDES package: Author: Alex M Chubaty [aut, cre], Eliot J B McIntire [aut], Yong Luo [ctb], Steve Cumming [ctb], Her Majesty the Queen in Right of Canada, as represented by the Minister of Natural Resources Canada [cph] Note, however, that Her Majesty’s role not as a package author (aut) but as the copyright holder (cph).

Using the latest GDAL with R packages on macOS

UPDATE: see more recent version of this post here. I wanted to play around with the new sf package, which requires the latest GDAL (>= 2.0.0), GEOS (>= 3.3.0), and PROJ.4 (>= 4.8.0). However, the version of GDAL installed via brew is 1.11.4, so I needed to update to the latest version and reinstall a few R packages in order to get sf to work on macOS. Update GDAL ## unlink the previous GDAL version brew unlink gdal ## update GDAL to the latest version (2.

meow: the most anticipated R package of 2015

In preparing a presentation on developing R packages using RStudio for the Victoria R Users Meetup Group this month, organizer Kiri Whan and I put together a very simple demo R package. UPDATE 2015/02/09: I didn’t notice the conflict with the package name; thanks Scott Chamberlain for pointing it out. I’ve renamed the package to meow and updated the links below. From the README at https://github.com/achubaty/meow: meow: Get random pictures of cats.

Installing rgdal on OSX

This is actually really easy to do, but most of the google hits I came across were old (from 2010) or horribly complex (building gdal and proj4 from source then building rgdal itself). First, this assumes you already have homebrew installed 1. If not, see http://brew.sh/ for the one-liner terminal install. Next, install gdal: brew install gdal Then open RStudio (for some reason it didn’t work using R in the terminal…) and install the package from source:

Constructing Pedigrees in R

I was looking for a good way to draw pedigrees using software, without having to fuss drawing them “by hand” using a drawing program. Lo and behold, I came across a few different packages in R that allow me to do just that! Using the kinship2 package, I was quickly able to produce a nice pedigree for a family with two genetic conditions: factor VIII deficiency (haemophilia) and myotonic dystrophy. Factor VIII deficiency is a classic example of a sex-linked recessive trait, and myotonic dystrophy follows autosomal dominant inheritance.

Exploring Population Dynamics Models using a GUI for R

Backstory I recently taught a senior-level population dynamics course, and had to decide how best to get my students to be able to play around with the various models we were exploring in class. I ruled out using Excel right away and thought about using Mathematicabecause of its wonderful plotting capabilities and relatively-easy to learn syntax. However, I felt that it would be more trouble that it was worth to try to get either a site license for the students to be able to use the computers at school, as I had ruled out asking the students to purchase their own student copies.