Adding informative alternative text (alt text) to images is a fundamental principle of web accessibility. Currently Shiny does not have an option to add alt text to a dynamic plot created with the renderPlot() function. This article demonstrates a method of achieving this.

Histogram plot showing HTML with accessibility features and attributes overlayed in the columns.
Histogram plot showing HTML with accessibility features and attributes overlayed in the columns.

A Common Problem

Having discovered that there was no equivalent of the renderImage() alt parameter for renderPlot() I started searching for solutions and found a in the . Within this thread a solution is referred to by using observers to add alt text to dynamic plots using their id, in the…


This tutorial shows you how to use the package to retrieve tweets from and explore the results using functions from the and packages. We’ll look at tweets with the hashtag over the New Year period and identify the most common emoji, hashtags, username mentions and words.

Install and load rtweet

You can install the package from by executing install.packages(“rtweet”). We then need to load the package along with the suite of R packages to manipulate the data and to tokenise the tweet text into words.

library(rtweet) ; library(tidyverse) ; library(tidytext)

Getting Twitter API access

Before you…


[M]ankind is challenged, as it has never been challenged before, to prove its maturity and its mastery — not of nature, but of itself.

Rachel Carson

By the middle of 2019 of the UK’s local councils had declared a ‘climate emergency’. Many of these also announced carbon reduction targets. For example, London and Greater Manchester have committed to net zero emissions targets by 2038.

To help councils prepare their climate change plans we’ve curated a . We sourced and cleaned local authority level datasets on a range of climate change indicators including carbon emissions…


The UK provides a range of geospatial datasets under the . Digital vector boundaries for different administrative and statistical geographies, postcode centroids and lookups are all available to freely download. This post will show you how to download digital vector boundaries for custom administrative geographies using the Open Geography Portal .

What’s available?

Digital vector boundaries on the Open Geography Portal come as , or files in full resolution or in one of three generalised formats:

  • Generalised (20m)
  • Super generalised (200m)
  • Ultra generalised (500m)

It is recommended that high…


This is a short introduction to creating choropleth maps in . We’ll show you how to load geospatial data, customise maps and join attributes.

What is Vega-Lite?

is an open source tool that allows you to turn raw data into a . You read, transform and encode your data to visual properties in a single file that can be embedded in a web page.

Setup

The easiest way to start creating maps in Vega-Lite is to use their . …


Most local government employees reach for spreadsheets when they need to create a chart. However, spreadsheet programs can reinforce bad visualisation practices by not making the process required to build a graphic explicit. Chart templates provide quick and easy ways to create a graphic but they teach little about how visualisations are constructed or how they encode data.

In this article, we recommend because it allows users to quickly build visually appealing static and interactive data visualisations in their web browser. …


Opening up government data enables third parties to develop innovative new tools that can help public services and the citizens that they serve. Our application uses reported crimes published by the Home Office on and digital vector boundaries available on the under the to visualise crimes and incidents of anti-social behaviour (ASB) at Local Authority, Electoral Ward and Lower-layer Super Output Area Level.

Using the app

The application is divided into four panes: summary, bar chart, time series, and map.

The four panes of Crime Scanner
  • The summary pane provides an overview of…


The is involved in one of the six EU-funded (OGI) pilot projects which aim to make better use of linked open statistical data to help improve the design and delivery of public services. Each pilot involves a technical partner responsible for creating tools that help standardise the publication of multidimensional data and a public sector agency tasked with exploiting them for the benefit of public services.

The aim of the is to help support teams in Greater Manchester that deliver services that help people into work by co-creating web applications that…


The have just released their Reachability plugin for , an open-source JavaScript library for interactive maps, which uses the API to create network distance buffers and travel time isochrones. A working version of the plugin is available on our mapping application.

The Reachability plugin enables users to draw areas of equal distance or travel time from a given location. This can be useful for:

- determining how many pharmacies are within a 10 minute walk of a GP
- comparing public transport accessibility with employment opportunities
- drawing school catchment areas

Knowledge of the distance…


Governments and other organisations often make available through Web service Application Programming Interfaces or APIs. The , , and are just a few well-known examples. This article details the steps required to request data from these different Web service APIs using .

Several R packages¹ have been developed as clients for Web service APIs. These don’t assume any knowledge of API endpoints, HTTP requests, or data formats like XML and JSON. These are really convenient but sometimes you want to break into the ‘black box’ of APIs …

A quick introduction to APIs

APIs or Application Programming Interfaces…

Trafford Data Lab

Supporting decision-making in Trafford by revealing patterns in data through visualisation.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store