Our brand-new baby received a fantastic picture book as a gift: Possum magic, a classic for Aussie kids. Thanks, Miles! In that book, Hush the possum and her Grandma Poss encounter different Australian animals and travel across well eat their way through the country. It is an adorable story with great illustrations! Reading it will make you feel like travelling to Australia, for instance to useR! 2018, except you shouldn’t because it is a very scary country:
Rough night with 👶. ☕ was a good start but it was the balcony 🐍 capture and release that really 💓— Miles McBain (@MilesMcBain) 25 d’agost de 2017
However, you can travel and learn geography without leaving the comfort of a snake-free home… by mapping Hush’s adventures! Which is what I decided to do.
We shall prepare data for the maps in two main steps: first, looking where one can find the animals mentioned in the book; second, attributing a longitude and latitude to the cities Hush goes to.
Locating the animals, snake included
In the book, we first learn about how the magic of Grandma Poss affects some animals: wombats, kookaburras, dingoes and emus. We then read how Hush’s invisibility (sorry, spoiler) makes her interact with koalas, kangaroos and snakes. We can imagine Hush and her grandmother live near these animals, in what is called “deep in the Australian bush”. We’ll map where all these animals live so that we can guess where Hush can live for the story to be credible (I admit that the magic part kind of throws this plan out the window, oh well). Moreover, given what Wikipedia says about the bush, Hush and her grandmother could live anywhere in Australia as long as it’s not in a city, and since Hush’s first city visit is in Adelaide, we can suppose she did not live too far away from there. Let’s see!
In order to map animals, we shall get occurrences from 2011 to 2016 via the rOpenSci spocc package, with GBIF as a data source, and using the scrubr package for cleaning, like in my blog post visualizing waxwings migration. When querying data via spocc one needs a bounding box, so I’ll first load an Australian map from the eechidna package, product from the rOpenSci 2016 Oz unconf. I was inspired by the code in this blog post that’s also a product from an Oz unconf.
library(&quot;eechidna&quot;)
library(&quot;ggthemes&quot;)
library(&quot;ggplot2&quot;)
data(nat_map_2016)
Let’s just draw an empty map.
ozmap