Friday, February 16, 2018

Vietnam interactive map with R (part 2)

This is the update on the Vietnam choropleth map from the previous post. I thank Loan Vu for providing me with the VHLSS data.

This map presents average annual household income from two sources : "Employment" (primary and secondary jobs-related) and "Agriculture" (a sum of income from "Cultivation", "Animal Husbandry" and "Agricultural, Forestry and Aquaculture" sources). The total income is shown in this. The updates are:
  • I provide values converted to $US here, rather than in VND as before (although doing this disregard purchasing power parity altogether!). 
  • A toggle button to select income types, plus a legend for each variable, are added.
  • As before, map is zoom-able. The min and max zoom parameters are slightly changed.
I haven't figured out how to add more than 2 layers without significantly reduce the loading time (not that the current loading time is that impressive!). Additionally, to make it more interactive, the legends should be toggled together with the map layers. I did write a better UI with Shiny, but publishing it requires premium account for Rstudio. Hopefully I can do more tinkering in the future, maybe after finishing my studies.

Disclaimer:  The information on this map was derived from digital databases from OpenStreetMap. OpenStreetMap is open data, licensed under the Open Data Commons Open Database License (ODbL) by the OpenStreetMap Foundation (OSMF). The map tile used is licenced as CC BY-SA.  For more about copyright, please see https://www.openstreetmap.org/copyright 

No comments:

Post a Comment

Please leave your comment here.