Abstract
Data visualization is a core component of the demographer’s workflow, as visualizations are essential to communicate the findings of demographic research. Recent advances in interactive data visualization have made it easier to produce dynamic web-based graphics in a variety of computing environments, including R, a popular tool for demographers. This article illustrates how to produce interactive charts and maps of demographic data in R using Plotly and Shiny, two frameworks for web-based visualization. Data for the examples come from idbr, a new R package to download demographic indicators from the US Census Bureau’s International Data Base.
Similar content being viewed by others
References
Abel, G. J., & Sander, N. (2014). Quantifying global international migration flows. Science, 343(6178), 1520–1522.
Arel-Bundock, V. (2014). Countrycode: Convert country names and country codes. https://cran.r-project.org/web/packages/countrycode/index.html.
Chang, W., Cheng, J., Allaire, J., Xie, Y., & McPherson, J. (2015). Shiny: Web application framework for R. https://cran.r-project.org/web/packages/shiny/index.html.
Dennett, A. (2015). Visualising migration: Online tools for taking us beyond the static map. Migration Studies, 3(1), 143–152.
Healy, K., & Moody, J. (2014). Data visualization in sociology. Annual Review of Sociology, 40, 105–128.
Howell, F. M., & Porter, J. R. (2013). Editorial welcome: Why spatial demography? Spatial Demography, 1(1), 1–2.
Kirk, A. (2012). Data visualization: A successful design process. Birmingham: Packt Publishing.
Muenchen, B. (2016). R Passes SAS in scholarly use (finally). r4stats.com, June 8. http://r4stats.com/2016/06/08/r-passes-sas-in-scholarly-use-finally/. Last accessed 7 July 2016.
Plotly Technologies Inc. (2015). Collaborative data science. Montréal, QC. https://plot.ly.
R Core Team (2015). R: A language and environment for statistical computing. R foundation for statistical computing, Vienna, Austria. https://www.R-project.org/.
Segel, E., & Heer, J. (2010). Narrative visualization: Telling stories with data. IEEE Transactions on Visualization and Computer Graphics, 16(6), 1139–1148.
Sievert, C., Parmer, C., Hocking, T., Chamberlain, S., Ram, K., Corvellec, M., & Despouy, P. (2016). Plotly: Create interactive web graphics via plotly’s javascript graphing library. https://cran.r-project.org/web/packages/plotly/index.html
Sparks, C. (2013). Spatial analysis in R: Part 1: Getting data from the ACS into R and exploratory data analysis. Spatial Demography, 1(1), 131–139.
Sparks, C. (2014). Measuring residential segregation using R: So long to factfinder. Spatial Demography, 2(1), 72–78.
US Census Bureau. (2013). International data base population estimates and methodology. http://www.census.gov/population/international/data/idb/estandproj.pdf.
Vaidyanathan, R., Xie, Y., Allaire, J., Cheng, J, & Russell, K. (2015). htmlwidgets: HTML widgets for R. https://cran.r-project.org/web/packages/htmlwidgets/index.html.
Walker, K. (2016). idbr: R Interface to the US Census Bureau International Data Base API. R package version 0.2. https://CRAN.R-project.org/package=idbr.
Wickham, H. (2016). ggplot2: Elegant graphics for data analysis (2nd ed.). New York: Springer.
Wickham, H., & Francois, R. (2016). dplyr: A Grammar of data manipulation. R package version 0.5.0. https://CRAN.R-project.org/package=dplyr
Wilkinson, L. (2005). The Grammar of graphics (2nd ed.). New York: Springer.
Yau, N. (2013). Data points: Visualization that means something. Indianapolis: Wiley.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Walker, K.E. Tools for Interactive Visualization of Global Demographic Concepts in R. Spat Demogr 4, 207–220 (2016). https://doi.org/10.1007/s40980-016-0029-1
Published:
Issue Date:
DOI: https://doi.org/10.1007/s40980-016-0029-1