Skip to content

garethparris/the-loan-rangers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Loan Rangers

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.

References

Setup SSL with Docker, nginx and Lets Encrypt

Data

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).

Code

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.

Shiny app

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!

Build the Docker image locally

docker build -t theloanrangers:latest .

for not running docker, use save:

docker save theloanrangers:latest | gzip > tlr_latest.tar.gz

for running or paused docker, use export:

docker export theloanrangers:latest | gzip > tlr_latest.tar.gz

Loading the Docker image

gunzip -c tlr_latest.tar.gz | docker load

Certificate initialisation

  • Rename nginx.conf.1 to nginx.conf
  • Run docker-compose up -d certbot
  • Revert nginx.conf back

Certificate auto renewal

  • Initialise crontab with crontab -e
  • Add 0 5 1 */2 * /usr/local/bin/docker-compose up -f /var/docker/docker-compose.yml certbot

Newbie

Update your ~/.Rprofile with:

local({r <- getOption("repos")
   r["CRAN"] <- "https://cloud.r-project.org"
   options(repos=r)
)

In the my-little-crony directory run (first time):

$ R 
> install.packages("rsconnect")
> install.packages("visNetwork")
> install.packages("tidyverse")
> install.packages("metathis")
> install.packages("igraph")
> install.packages("shiny")

Set the connection info

rsconnect::setAccountInfo(name='the-loan-rangers', token='<TOKEN>', secret='<SECRET>')

Run the app:

R -e "shiny::runApp('.')"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 87.3%
  • JavaScript 6.0%
  • SCSS 2.6%
  • Less 2.6%
  • CSS 1.1%
  • R 0.3%
  • Other 0.1%