Code Monkey home page Code Monkey logo

legco_2018_byelection's Introduction

LegCo 2018 By-Election Analysis

Political alignment and demographics in 2018 Hong Kong Legislative Council (LegCo) By-election

What it does

An attempt to find out the correlation between demogrpahics and political support by combining data from the 2016 by-census and the vote counts of every counting station in the 2018 LegCo By-election.

What they are

Three interactive maps:

  1. Winning political camp and margin of votes in each District Council constituency (preview here)
  2. Monthly median income in each District Council constituency (preview here)
  3. Home ownership rate in each District Council constituency (preview here)

and an R script that creates them.

How it works

Each counting station in the 2018 LegCo By-election has a code with a prefix letter that corresponds to the District Council Contituency Areas (DCCA). Geographical demographics from the government census is also based on DCCA. By mapping the political support and demographics in each DCCA, it provides a glimpse of the relationship between the two.

This method is not perfect. Some DCCA do not have their own counting stations and their votes are counted in stations in neighbouring DCCA instead. This explains the grey out area in the map, most notably Sai Kung Islands. This affects the validity of the result.

What you need

The R script automatically fetches the 2018 By-Election result and 2016 By-census data.

All other packages are obtainable from CRAN.

Reference

The function to implement the shapefile in R is taking reference to stanyip/DC2015.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.