Inspiration
So often, we hear the same story every time a government falls, or civil rights take a turn for the worse: "Who could have seen this coming?" As we know, however, history repeats itself, and we think that by studying the past, we can predict the future. We wanted to turn "How did this happen?" into "This is what will happen". Combining our skillsets as a computer scientist well versed in software, and a statistician interested in social justice and morality, we wanted to find a way to learn from democratic breakdowns of the past, and track the markers that signify political decline, so that everyone can be aware of and prepared for what may happen next.
What it does
RISC is a tool that takes in huge amounts of historical and current data, collected by the VDEM-Institute, and uses it to predict and model democratic breakdowns and other metrics of civil liberties. It graphically represents changes in selected indicators over time, updating every time that VDEM updates their data. Users can select different countries and indicator variables in order to see their distributions. RISC also includes its own score, calculated for based on each country's aggregated scores of a selected set of relevant indices.
How we built it
The RISC platform was designed as a modular, data-driven web application that integrates statistical computing, automated data pipelines, and client-side interactivity. All data processing, cleaning, transformation, and scoring computations were conducted in R, as we decided to take advantage of its prevalence in statistics-based fields for reproducible research. RISC ingests large-scale country- and continent-level datasets containing thousands of observations across hundreds of social conflict indicators.
We structured our R environment to standardize and clean raw datasets, compute derived indicators, construct composite metrics used in the RISC score, and generate visualizations for each country. Each country’s outputs are rendered programmatically to standalone HTML files. This approach ensures that every visualization and analysis is reproducible and version-controlled, as well as being directly traceable to its underlying data.
To enable interactivity without requiring server-side computation or losing our R integration, we adopted a static-site architecture with dynamic front-end routing. R-generated HTML outputs are organized within a searchable directory structure indexed by country and topic. On the client side, JavaScript dynamically updates embedded content by locating and loading the appropriate pre-rendered HTML file when a user selects a country or indicator. This design offers the advantages of no server-side execution required, rapid load times through pre-rendered assets, scalable architecture capable of supporting hundreds of countries, and separation of computation (in R) and interaction (JavaScript).
The RISC platform references large-scale datasets containing thousands of datapoints per country across diverse thematic areas. Because of the size and frequency of updates to these datasets, we use Git Large File Storage (Git LFS) within our repository to manage version control efficiently while maintaining repository performance. This allows us to track historical dataset versions, maintain clean repository structure, and support very large databases without compromising our workflow.
The RISC score is constructed through a multi-indicator aggregation framework implemented in R. On the By Country and Methods pages of our website, you can view country-specific RISC results and examine contributing factors. We explain the weighting and aggregation logic here as well. With this, it is possible to explore how institutional indicators affect societal outcomes.
By combining R’s analytical power with JavaScript-driven dynamic rendering and Git LFS–managed large-scale datasets, RISC delivers a robust, research-grade platform within a lightweight web-hosted environment.
Challenges we ran into
We had to figure out how to incorporate R code into HTML. This involved a lot of reformatting using Quarto and figuring out how to properly save and render documents.
Accomplishments that we're proud of
Both of us learned new things in this project, and we are very proud of how much we managed to get done. One of us is more familiar with R as a coding language, so we had to find a way to integrate R code into a website, which we had never previously done. We were able to smoothly combine our two skill sets, statistics and software. We also created our own heatmap for the first time, and learned a lot about mapping tools in R.
What we learned
We learned how to integrate R with languages like HTML and Python, and how to display R code and visualizations interactively in a website. We learned how to make interactive heat maps, and plots that can be updated and changed by the user.
What's next for Risk Indicator of Social Conflict (RISC)
We would love to expand RISC by adding in more datasets and indicator variables, as well as including some more statistical tools and visualizations, like countdown clocks and regression models. Coming soon.
Built With
- css
- html
- javascript
- procreate
- quarto
- r
Log in or sign up for Devpost to join the conversation.