Skip to content

CSGJusticeCenter/MCLCShiny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCLCShiny

This projects conducts a survey to all 50 states asking for data on the number of supervision violations that result in an individual returning to prison.

Links current live version on shinyapps.io: mclc_comms

App show on CSG Website: Supervision Violations and their Impact on Incarceration

Additional Documentation: docs/gen_documentation.qmd; resulting html on SharePoint: 50 State Revocations Project/MCLC Shiny App/SVII_Shiny_Documentation.html

Staff

Staff/Version
Published
Alpha $\alpha$
2019
Beta $\beta$
2021
Gamma $\gamma$
2024
Delta $\delta$
2025
Jessica Saunders x x x x
Martha Eichlersmith - - x x
Jess Gonzales-Bricker x - x
Joshua Mallett - x x May'25
Sebastian Guzman - - - May'25
Mari Roberts x x -
Angela Gunter - x -
Emily Rogers x - -

Data, Reports, and Previous Names

SharePoint folders listed below are sub folders of JC Research - Documents/50 State Revocation Project.

Delta $\delta$: Publish in 2025

Supervision Violations and their Impact on Incarceration (SVII)

Published Product will be the same url; hasn't been updated yet
Report and Webtool: Supervision Violations and their Impact on Incarceration
Data Years Included 2018-2023
Releases app v4.0.00, expected by Dec 2025 (demographic tab on state dashboard)
app v3.0.00, expected by July 2025 (aggregate counts only)
Data Collection Time frame June 2024 - February 2025
Requested Data 2022 and 2023: supervision data (demographic breakouts of data), cost of incarceration, also request discretionary parole data which was used on different project
Data Collection Format ask states to submit data via email in format of their choosing
* have multiple different file types and in many cases multiple files for each state
* have unique import file for each state since each state has a different way of providing data
SharePoint Folder SharePoint Folder: 50 State Survey (2024)
Survey Data Code 50_state_revocations/2024_survey
National Estimates svii_survey
App code MCLCShiny (this repository)

Gamma $\gamma$: Publish in 2024

Supervision Violations and their Impact on Incarceration (SVII)

Published Product Report and Webtool: Supervision Violations and their Impact on Incarceration
Data Years Included 2018-2021
Releases app v2.0.00, April 2024 <- updated language on Hispanic RRI's from v1.0.00, Feb 2024
Data Collection Time frame ~2022
Requested Data 2021: supervision data and cost of incarceration
Data Collection Format states submit data via Google spreadsheet
* have one spreadsheet per state; send states links to google spreadsheet
* Google Sheet Template
* A few states emailed Excel workbooks (could not access google products on work computers)
* Mari/Martha have google account and can access spreadsheets
* Need to request a google account from IT, using CSG email
SharePoint Folder 50 State Survey (2022)
Survey Data Code and National Estimates MCLC_Survey
App code MCLCShiny (this repository)

Beta $\beta$: Publish in 2021

More Community Less Confinement (MCLC)

Published Product Report: More Community Less Confinement
Data Years Included 2018-2020
Release September 2021
  • SharePoint folder: 50 State Survey (2020)
    • request 2018-2019 data, partial 2020 data
    • online survey
  • SharePoint folder: 50 State Survey (2021)
    • request 2020 data?
    • minimal information/files in this folder; likely related to covid issues -- appears there was no data collection from states housed in this folder
  • survey code: cc_survey

Alpha $\alpha$: Publish in 2019

Confined and Costly (CC)

Published Product Report: Confined and Costly ; Methodology
Data Years Included 2017
Release June 2019

Repo Structure

Branching Structure

trunk                    # production branch 
└── develop              # development branch 
    ├── taskbranch1      # working branch 
    └── taskbranch2      # working branch 

Files

MCLCShiny 
├── app
|   ├── data          # rds files of data frames and highchart objs 
|   |   └── plots     # pngs for download  
|   ├── www             
|   |   ├── fonts     # folder with Graphik font used in app 
|   |   └── theme.R   # custom CSS for app 
|   |
|   ├── colors. R     # assigned colors
|   ├── dataframes.R  # loads converted data, fonts  
|   ├── functions.R   # custom functions  
|   |
|   ├── global.R      # 1/3 app files: load packages/data  
|   ├── ui.R          # 2/3 app files: user interface  
|   └── server.R      # 3/3 app files: server 
|
├── docs # folder with documentation files 
|
├── logs # folder with log txt files 
|
├── prep # folder for prep data/charts/imgs for app 
|  ├── 0_shiny_prep.R        # run shiny prep, creates logs 
|  ├── 2a_import_survey.R    # imports data and prepare for charts/tables 
|  ├── 2b_import_text.R      # import text for state notes/missingness notes 
|  ├── 3a_highchart_fnc.R    # functions/prep for creating highchart objects 
|  ├── 3b_highchart_create.R # create highchart objects used in app 
|  ├── 3c_highchart_html.R   # create highcharts for download, save as html
|  └── 3d_highchart_png.R    # save htmls from 3c to pngs 
|
| # THIS FOLDER HAS NOT HAD PATHWAYS UPDATED; WILL NOT RUN AS IS 
└── prep_rri          # folder for prep data/info for rri (race/ethnicity) infographics 
    ├── box           # box modules for preping R/E data 
    ├── infographics  # exploration data 
    ├── run_save.R    # shiny prep for R/E infographs & tables
    ├── shiny_prep.R  # run shiny prep (for rri info only) 
    |...              # various files for exploration/documentation 

Run App

After creating a clone, there are a few other steps you will need to take in order to run the app.

  • Download necessary packages and versions, renv::restore()
  • Run the prep/0_shiny_prep.R file to create items need for app by doing the following steps
    • data prep (1-2 min)
      • description: import and prepare data for app
      • scripts: 2a_import_survey, 2b_import_text, and 2c_import_demo.R
      • log file: shiny_prep_log_dataprep.txt
      • outputs: saves rds files within repo and on SharePoint
    • create documentation file and put version on SharePoint
    • create highchart objects (~2min)
      • description: pre-generates highchart objects (hex map, area charts, bar charts) for app
      • scripts: 3a_highchart_fnc and 3b_highchart_create
      • log file: shiny_prep_log_hc_create.txt
      • outputs: saves rds files within repo and on SharePoint
    • create highchart objects for printing (~45min to 3 hours)
      • description: create new version of html objects that include data point labeling and the csg logo
      • scripts: 3a_highchart_fnc and 3c_highchart_html
      • log file: shiny_prep_log_hc_html.txt
      • outputs: saves html files within repo only
      • huge disparity on the length of time to run this code, depends on machine bandwidth; its faster if you start shiny_prep with a new session of R
    • save pngs from highchart objects (~30min )
      • description: take the html objects create in previous step and take a screenshot and save as a pngs
      • scripts: 3a_highchart_fnc and 3d_highchart_png
      • log file: shiny_prep_log_hc_pngs.txt
      • outputs: saves png files within repo and on SharePoint
  • Run app
    • open one of the main app files (global.R/ui.R/server.R) and click the Run App button
    • entering shiny::runApp() into the console

Note on Pathway to SharePoint

  • Must download csgjcr package. If you run into issues, make sure in your Renviron that CSG_SP_PATH = "your sharepoint path here" and GITHUB_PAT = "your token here"
  • You may need to change your root folder variable depending on how you sync your SharePoint folder
  • Open the prep/box/ROOT.R file, and edit the sp string to reflect your root folder
  • The root folder should be the string you would enter into the csgjc::csg_sp_path() function to get the pathway to the MCLC Shiny App folder on SharePoint

Shiny Releases

Releases are made up of 3 values and shown in the format of v0.0.00

First Number: 1.0.00 - indicates version that is 'live' (e.g. shipped to client, publicly available on website)
Second Number: 0.1.00 - indicates a version that was shared with the broader external working group
Third Number: 0.0.01 - any time a new version is pushed to the R Shiny servers, but is not shared externally from research or live

Other Data

In addition to the data direclty from the state, this tool also uses other publically available data on the demographic tab on the state dashboards.

Census Pep

BJS PPUS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •