This repo contains the data and code for my Shiny App, The Loan Rangers, visualizing links between Tory politicians, companies and people related to the Loan Charge Scandal.
The Loan Rangers is based on the original My Little Crony by Sophie E. Hill.
Setup SSL with Docker, nginx and Lets Encrypt
The raw data is contained in two files: people.csv
identifies individuals and organizations (i.e. the "nodes" of the network) and connections.csv
identifies the links between individuals and organizations (i.e. the "edges" of the network).
The script code.R
adds some attributes to the data to aid visualization, like specifying the icon type, colour, size. The data files are then resaved as people.RData
and connections.RData
.
The file app.R
contains the Shiny app. It can be run locally on your machine or you can see the final product here on the web!
docker build -t theloanrangers:latest .
docker save theloanrangers:latest | gzip > tlr_latest.tar.gz
docker export theloanrangers:latest | gzip > tlr_latest.tar.gz
gunzip -c tlr_latest.tar.gz | docker load
- Rename
nginx.conf.1
tonginx.conf
- Run
docker-compose up -d certbot
- Revert
nginx.conf
back
- Initialise crontab with
crontab -e
- Add
0 5 1 */2 * /usr/local/bin/docker-compose up -f /var/docker/docker-compose.yml certbot
Install R from https://cran.r-project.org/
local({r <- getOption("repos")
r["CRAN"] <- "https://cloud.r-project.org"
options(repos=r)
)
$ R
> install.packages("rsconnect")
> install.packages("visNetwork")
> install.packages("tidyverse")
> install.packages("metathis")
> install.packages("igraph")
> install.packages("shiny")
rsconnect::setAccountInfo(name='the-loan-rangers', token='<TOKEN>', secret='<SECRET>')
R -e "shiny::runApp('.')"