How oliversinn/polio-risk works
Overview of the Project Type and Purpose
• This project is an R-based analytical tool for assessing the risk of polio outbreaks. Its core functionality centers on data handling, geospatial processing (using shapefiles), risk evaluation, dashboard visualization, and report generation.
Analyzing the File Structure – Key Directories and Files
• Top-Level Files:
• Files like .Rprofile, README.md, install.R, and the .Rproj file provide the project’s configuration and startup.
• The renv directory indicates dependency management, so include an “Environment & Dependencies” block.
• Data Layer:
• The “src/Data” directory holds the country data (Excel files) and shapefiles (admin2.* files) used for mapping.
• The “template” directory contains language-specific templates for data input.
• R Scripts and Modules:
• “src/R/Dashboard” – Contains the code for the Shiny dashboard (ui.R, server.R) plus resources (HTML, CSS, downloadable Excel/Word reports), which form the user interface layer.
• “src/R/Modals” – Likely contains modal dialog components (configuration and QA modals).
• “src/R” – Also holds files for risk evaluation (risk_eval.R), report generation (report_html.Rmd, report_word.Rmd), language and label management, and backup files.
• “src/run.R” is used to execute the tool, whereas “src/qa.R” is dedicated to quality control.
• Geospatial Processing:
• The “src/Shapefile_prep” directory includes scripts and configuration files (shapefile_settings.xlsx, geodata_to_shapefiles.R) for standardizing input shapefiles using tools like mapshaper, with geodata and configurations stored for further processing.
Main Components
a. Environment & Dependencies:
• R, RStudio, and required R packages (managed via renv).
• External dependencies like web browsers (for the interactive dashboard) and Excel (for data templates).
b. Data Input & Data Sources:
• Shapefiles and Excel files for country data.
• Templates from the “template” folder for multi-lingual data entry.
c. Geospatial Processing Component:
• The “Shapefile_prep” module (script: geodata_to_shapefiles.R) that converts raw geodata formats (SHP/JSON) into standardized shapefiles.
• The output (standardized shapefiles and geocoding Excel file) stored within “src/Data”.
d. Analytics & Processing Layer:
• Risk evaluation engine (risk_eval.R) which uses the prepared data to compute risk levels.
• Data cleaning, translations, and label processing modules (e.g., lang_label_cleanup.R).
e. User Interface - Dashboard:
• Dashboard module (with ui.R and server.R) hosted on a web browser.
• Additional components such as modals (configuration and quality assurance modals) and supplementary assets (CSS, downloadable reports).
f. Reporting & Quality Assurance:
• Reporting components generating HTML and Word reports (report_html.Rmd, report_word.Rmd).
• A dedicated QA module (qa.R) to verify the tool’s outputs.
g. Execution and Control:
• The run scripts (run.R and qa.R) which kick off the overall workflow and quality control processes.