New Zealand · R

New Zealand Names

This is just showing how to process the New Zealand baby names spreadsheet provided by the New Zealand Governemnt, and also make streamgraphs, available from github with devtools::install_github(“hrbrmstr/streamgraph”) download.file(“https://smartstart.services.govt.nz/assets/files/Top-baby-names-1954-2016.xlsx&#8221;, destfile=”babynames.xlsx”, mode=”wb”, method=”libcurl”) library(readxl) library(dplyr) library(streamgraph) female <- read_excel(“~/Desktop/babynames.xlsx”, sheet = “Girls’ Names”, col_names = FALSE, skip = 7) female <- female[1:100,] male <- read_excel(“~/Desktop/babynames.xlsx”, sheet… Continue reading New Zealand Names

R

A fix for Qualtrics random selection data

Sometimes I get the problems no-one else has a solution for, particular those involving data transformation. Qualtrics (online survey tool) lets you create random selection questions, where you provide a pool of answer options and set Qualtrics to randomly display a specified number of the answer options to the person doing the survey. Which can… Continue reading A fix for Qualtrics random selection data

New Zealand · R

The right map projection

You know how people say it is important to use the right map projection? What they said, illustrated. library(maps) library(mapproj) png(filename=”default.png”, width = 320, height = 320) map(“nz”) dev.off() projec <- “mercator” png(filename=paste(projec ,”png”, sep=”.”), width = 320, height = 320) map(“nz”, proj=projec) dev.off() projec <- “sinusoidal” png(filename=paste(projec ,”png”, sep=”.”), width = 320, height =… Continue reading The right map projection