More cartograms of New Zealand census data (district and city level)!

April 24, 2017

[This article was first published on Peter's stats stuff - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Just a short note to say that I’ve finished creating an experimental map of New Zealand by the 66 Territorial Authorities (districts and cities), with area expanded or shrunk to be proportional to population at the 2013 census. This is in addition to the 16 Regional Council divisions I blogged about a couple of days ago. It’s available in the nzcensus R package.

So some static plots:

And an enhanced Shiny web-app:

Code for producing the static images:

# Latest version of nzcensus package:


# we need make_legend() and colour_scale() as defined in

comb_data_ta <- ta_cart@data %>%
   left_join(TA2013, by = c("Name" = "TA2013_NAM")) %>%

par(font.main= 1, fg = "grey75")
     col = colour_scale(comb_data_ta$PropNoQualification2013))
title(main = "People with no qualification; areas sized by usual resident population")
            title = "Percentage of all individuals\nwith no qualification",
            location = "left", cex = 0.8)

par(font.main= 1, fg = "grey75")
     col = colour_scale(comb_data_ta$PropLabourers2013))
title(main = "Labourers as a percentage of those with occupation;\nareas sized by usual resident population")
            title = "Percentage of all individuals\nwho are labourers",
            location = "left", cex = 0.8)

Also available for the Shiny app:

To leave a comment for the author, please follow the link and comment on their blog: Peter's stats stuff - R. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)