Introduction

These are all the graphics used on the home (https://fergustaylor.github.io/Arran/) page.

N.B. The previews shown underneath their code often look cramped here. This is because the image elements shuffle themselves around depending on the available dimensions, rather than scaling at a set ratio. As such you can create much nicer images by running the same code through the console and exporting the image at custom (larger) dimensions.

Dependencies

N.B. There are codeblocks here which have been hidden by default as they are just repeats of the start of ‘code’. This just the point where in a new environment you would need to load up the same packages as before, and import/create the data in ‘code’, to make the below graphics produceable in R. Anything new starts after ///.

If you’d like to see this code, it’s visible in the .rmd at ‘front_page_graphics.Rmd’.. Or directly from github https://github.com/fergustaylor/Arran (in /docs).

///

Front-Page Graphics

First - create a small function to make the plots work.

function0.5 <- function(argument) 
{
  filter(arransimd, DataZone==argument)
}

r function0.5 <- function(argument) { filter(arransimd, DataZone==argument) }

The code for each plot is hidden by default, select ‘code’/‘hide’ on the right to individually show/hide the code used for each plot.

plot1 <- ggplot() +
  theme_grey() +
  geom_point(data = arrancoordinates, 
             mapping = aes(x = longitude, y = latitude), size=1) +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()) +
  coord_sf(crs= 4326, datum = sf::st_crs(4326))

plot2 <- ggplot() +
  geom_sf(data = arransubsect) +
  theme_grey() +
  geom_point(data = arrancoordinates, 
             mapping = aes(x = longitude, y = latitude), size=1) +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()) +
  coord_sf(crs= 4326, datum = sf::st_crs(4326))

plot3 <- ggplot() +
  geom_sf(data = arran2016) +
  theme_grey() +
  geom_point(data = arrancoordinates, 
             mapping = aes(x = longitude, y = latitude), size=1) +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()) +
  coord_sf(crs= 4326, datum = sf::st_crs(4326))

plot4 <- ggplot() +
  geom_sf(data = arransubsect) +
  geom_sf(data= function0.5("S01004372")) +
  geom_point(data = arrancoordinates[namingdzpostcode[[2]],], 
             mapping = aes(x = longitude, y = latitude), size=1) +
  theme_grey() +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()) +
  coord_sf(crs= 4326, datum = sf::st_crs(4326))

plot5 <- function0.5("S01004372") %>%
  ggplot() +
  geom_sf() +
  theme_grey() +
  geom_point(data = arrancoordinates[namingdzpostcode[[2]],], 
             mapping = aes(x = longitude, y = latitude), size=1) +
  theme(axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank()) +
  coord_sf(crs= 4326, datum = sf::st_crs(4326))

grid.arrange(plot1, plot2, plot3, plot4, plot5, nrow = 1)