R bloggers

Moving parts of a country over a map

FavoriteLoadingAdd to favorites

I love making maps, I also love making gifs.In this short post I make an animated gif of parts of a map moving. In this case the parts of the map only move in the xy direction, but you can also turn them, and make them bigger or smaller.Today I show you how I made a part of the Netherlands ‘float away’. It is part of a larger nonsense project (I have many silly projects), and mostly just to document my path to learning about spatial analytics. End result : General principles make small functions that do one thing well (not that small in this case) combine those make imagemagick canvas write to the canvas animate the canvas loading libraries and data suppressMessages(library(tidyverse)) # ggplot2, dplyr, purrr, etc. library(magick) library(sf) library(paletti) # thanks @edwinthoen # colorscheme dutchmasters_fill <- get_scale_fill(get_pal(dutchmasters)) #…
Original Post: Moving parts of a country over a map