## Dissolve polygons in R

Dissolving polygons is an elementary GIS task that I need to perform regularly. A dissolve removes internal boundaries, leaving only the outline. Packages Install and load the packages we’ll need. I use sf because it’s more intuitive than rgdal, and I’m loading tidyverse because it plays well with sf. # install.packages(c("tidyverse", "sf")) library("tidyverse") library("sf") Boundary data Download the shapefile we’re going to dissolve. tmp_dir = tempdir() tmp = tempfile(tmpdir = tmp_dir, fileext = ". [Read More]

## Clip polygons in R

Clipping polygons is a common GIS task. For example, you might want to study local authorities (LADs) in the Yorkshire and the Humber region but can only obtain a shapefile with all the LADs in England. Removing all the LADs outside of the Yorkshire and the Humber can be achieved by ‘clipping’ the LADs, using the extent of the larger region as a template. HUGOMORE42 First, install and load sf for loading the shapefiles, and tidyverse for manipulating the data and plotting the maps. [Read More]

## Set root directory for knitr

Knitr, by default, looks in the same directory as your .Rmd file to find any files you need to draw in, like data sets or script files. If you keep your data files and scripts in separate folders (and you should) you need to configure knitr.

## Glossary and acronyms in LaTeX

To write a glossary in LaTeX you need to use a specific packages designed for the purpose. It then allows you to define a term and its acronym in a file, then reference the item later. The first time the item is referred to the full label and acronym are displayed automatically:

United Kingdom (UK)

All subsequent times you reference the item LaTeX just the acronym is shown:

UK