This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a pixel chart of a picture, inspired by https://blog.datawrapper.de/weekly-chart-data-art-scatterplot-with-a-pearl-earring/ | |
# My workflow: | |
# Open an image in GIMP, scale to desired size and change Mode to Indexed with max number of colours. | |
# Run following R code to get coordinates and RGB. (Alternatively could use imagemagick in command line and eg sed/awk.) | |
# Load CSV into Datawrapper; manually set colours (if few enough) or use API. | |
library(magrittr) | |
library(magick) | |
library(readr) | |
library(stringr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Plonk the largest islands together on the page | |
# I was going to both make these to scale, and animate between them, but | |
# didn't have enough time up my sleeve. | |
library(glue) | |
library(dplyr) | |
library(sf) | |
library(rnaturalearth) | |
library(ggplot2) | |
library(patchwork) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(stringr) | |
library(dplyr) | |
library(sf) | |
library(rmapshaper) | |
library(roughsf) | |
# https://datafinder.stats.govt.nz | |
ta <- | |
st_read("2021/statsnz/territorial-authority-2021-clipped-generalised.gpkg") |> | |
filter(! TA2021_V1_00 %in% c("067", "999")) |> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple map of state highways | |
library(dplyr) | |
library(sf) | |
library(ggplot2) | |
library(sysfonts) | |
font_add_google("Tinos") | |
COL_FG <- "white" | |
COL_BG <- "black" | |
MAP_FONT <- "Tinos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take https://gist.github.com/dakvid/3bc77f4d3c2da742113229ba11b5cc8b | |
# and make it 3d with rayshader | |
library(glue) | |
library(stringr) | |
library(dplyr) | |
library(sf) | |
library(rmapshaper) | |
library(ggplot2) | |
library(rayshader) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Animate an expanding buffer around land, with a "globe" view of the Pacific | |
library(glue) | |
library(stringr) | |
library(dplyr) | |
library(purrr) | |
library(sf) | |
library(rnaturalearth) | |
library(ggplot2) | |
library(av) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take the geocoded album covers from Audioculture and plonk them on a map :-) | |
# Don't obviously see options to control the size of the images :-/ | |
library(curl) | |
library(jsonlite) | |
library(stringr) | |
library(purrr) | |
library(dplyr) | |
library(sf) | |
library(rmapshaper) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Take the full Kontur dataset (if the machine can handle it) and show only those | |
# that match where I live | |
library(dplyr) | |
library(sf) | |
library(ggplot2) | |
# https://data.humdata.org/dataset/kontur-population-dataset | |
kontur <- | |
st_read("kontur_population_20220630.gpkg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Overlay New Zealand on a map of Westeros | |
library(dplyr) | |
library(sf) | |
library(rmapshaper) | |
library(ggplot2) | |
# https://www.cartographersguild.com/showthread.php?t=30472 | |
locations <- | |
st_read("GoTRelease/locations.shp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compare Kontur Population Grid against Stats NZ grids for Wellington City | |
# For #30DayMapChallenge 2022 - Day 21 | |
library(dplyr) | |
library(sf) | |
library(rmapshaper) | |
library(ggplot2) | |
# Kontur data ----------------------------------- |
NewerOlder