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
# Create a bubble grid of New Zealand population using | |
# data for Statistical Areas 2 | |
# For #30DayMapChallenge day 1 - points | |
# -- David Friggens, November 2021 | |
library(readr) | |
library(sf) | |
# Get the centroids for SA2s | |
# From https://datafinder.stats.govt.nz |
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 map of Waikanae streets coloured by whether the name is Māori or English | |
# using OpenStreetMap data, with some inspiration from | |
# https://erdavis.com/2019/07/27/the-beautiful-hidden-logic-of-cities/ | |
# https://github.com/erdavis1/RoadColors | |
# For #30DayMapChallenge 2021 day 2 - lines | |
# -- David Friggens, November 2021 | |
library(magrittr) | |
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
# #30DayMapChallenge 2021 - Day 3 - Polygons | |
# Displaying the local board ares of Auckland | |
# -- David Friggens, November 2021 | |
library(magrittr) | |
library(dplyr) | |
library(tidyr) | |
library(stringr) | |
library(purrr) | |
library(sf) |
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 Dorling Cartograms of NZ election results | |
# For #30DayMapChallenge 2020 days 5-9 | |
# -- David Friggens, November 2020 | |
library(magrittr) | |
library(glue) | |
library(readr) | |
library(dplyr) | |
library(tidyr) | |
library(sf) |
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
# Map connecting each New Zealand settlement with it's nearest largest neighbour | |
# For #30DayMapChallenge 2020, day 15 (connections) | |
# Inspired by https://twitter.com/AndriyYaremenko/status/1327885776047239168 | |
# -- David Friggens, December 2020 | |
library(dplyr) | |
library(stringr) | |
library(tidyr) | |
library(sf) | |
library(ggplot2) |
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
# Transform lines to all start from the same origin | |
# Specifically every "Rata Street" so it looks (a bit) like a rata flower | |
# for #30DayMapChallenge day 06 - red | |
# -- David Friggens, November 2021 | |
library(dplyr) | |
library(sf) | |
library(ggplot2) | |
library(showtext) | |
showtext_auto() |
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
# The monochrome cityscape of Wellington, inspired by several blog | |
# posts and challenge submissions (haven't noted them all). | |
# I used my work's dark blue and highlighted the office building. | |
# It didn't stand out as much as I expected (obvious in hindsight) | |
# but I left it in anyway. :-) | |
# -- David Friggens, November 2021 | |
# Setup ------------------------------------------------------------------- |
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
# Make a black and white elevation map of Kāpiti Island, New Zealand | |
# adapting https://github.com/AmitLevinson/30daymapchallenge/blob/main/2021/09_monochrome/monochrome.R | |
# for #30DayMapChallenge 2021 - Day 10 - Raster | |
# -- David Friggens, November 2021 | |
library(elevatr) | |
library(rayshader) | |
library(sf) | |
library(dplyr) |
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 3d plot of Christchurch population density | |
# for #30DayMapChallenge 2021 - Day 11 - 3D | |
# -- David Friggens, November 2021 | |
# Really helped by Iva Brunec to get this to work! | |
# https://github.com/ivabrunec/30daymapchallenge/blob/main/scripts/day11_3D.R | |
# Data preparation more general to allow more areas to be done, | |
# but decided to just do one for now and come back later! |
OlderNewer