Code

library(curl)
## Using libcurl 8.10.1 with Schannel
library(data.table)
library(ggplot2)
library(jsonlite)

# https://pldr.org/dataset/epjwe/
dt <- fread("https://pldr.org/download/epjwe/cfv/p_1_10_2017_Q1_LSOA.csv") 

setwd("C:/Repos/Demo_R")


# https://geoportal.statistics.gov.uk/search?collection=Dataset&sort=-created&tags=all(LUP_LSOA_UTLA)
lsoa_lkp <- fread("Lower_Layer_Super_Output_Area_(2011)_to_Upper_Tier_Local_Authorities_(2017)_Lookup_in_England_and_Wales.csv")
lsoa_lkp <- lsoa_lkp[,c(1,3,4)]
colnames(lsoa_lkp) <- c("lsoa11","lad","name")

dt1 <- merge(dt, lsoa_lkp, by="lsoa11", all.x = T)
dt1 <- dt1[dt1$lad %in% c("E11000001","E11000002","E11000007","E13000002","E06000045")]

graph1 <-dt1[, list(items= sum(items), pop=sum(all_ages)), by= .(lad, name)]

graph1$rate <- (graph1$items/graph1$pop) * 1000

p <- ggplot(data=graph1, aes(x=name, y=rate)) +
  geom_bar(stat="identity", fill="steelblue")+
  labs(y="Items per 1000 people", x = "Upper Tier Local Authority")+
  theme_minimal()

Plot

Here is our embed plot: