Architecture Overview

This page shows how the micromort package is organized: the data pipeline, function hierarchy, user entry points, and development workflow. All diagrams are auto-generated from package metadata via the targets pipeline.

1. Data Pipeline

The targets pipeline processes risk data through five stages. Target counts update automatically when plan files change.

Show code
emit_mermaid("vig_arch_pipeline_diagram",
             "Pipeline diagram requires `tar_make()` to render.",
             caption = "Figure 1: Data pipeline showing five processing stages from raw risk data through targets to vignette outputs.",
             alt_text = "Mermaid flowchart showing the five-stage targets data pipeline: raw data ingestion, cleaning, aggregation, modelling, and vignette export.")


Figure 1: Data pipeline showing five processing stages from raw risk data through targets to vignette outputs.

2. Function Hierarchy

All exported functions grouped by category. Click any function to view its documentation.

Show code
emit_mermaid("vig_arch_concept_diagram",
             "Concept diagram requires `tar_make()` to render.",
             caption = "Figure 2: Exported functions grouped by category — risk data, conversion utilities, regional analysis, visualisation, and quiz.",
             alt_text = "Mermaid diagram showing all exported functions organised into five categories with links to their documentation pages.")


Figure 2: Exported functions grouped by category — risk data, conversion utilities, regional analysis, visualisation, and quiz.

3. User Journey

Which function should you start with? Follow the decision tree below.

Show code
emit_mermaid("vig_arch_user_journey_diagram",
             "User journey diagram requires `tar_make()` to render.",
             caption = "Figure 3: Decision tree guiding users from their question (compare risks, explore regions, convert units) to the appropriate function.",
             alt_text = "Mermaid decision tree flowchart with three entry points — compare risks, explore regions, convert units — leading to specific package functions.")


Figure 3: Decision tree guiding users from their question (compare risks, explore regions, convert units) to the appropriate function.

4. Developer Workflow

The 9-step workflow for contributing to this package. Steps 4–5 follow the RED-GREEN TDD cycle.

Show code
emit_mermaid("vig_arch_developer_diagram",
             "Developer diagram requires `tar_make()` to render.",
             caption = "Figure 4: Nine-step contributor workflow from issue creation through TDD (steps 4–5), documentation, CI checks, and PR merge.",
             alt_text = "Mermaid flowchart showing a nine-step development workflow: issue, branch, plan, RED test, GREEN implementation, refactor, document, check, and PR.")


Figure 4: Nine-step contributor workflow from issue creation through TDD (steps 4–5), documentation, CI checks, and PR merge.

5. Targets DAG

Auto-generated dependency graph of the full targets pipeline.

Show code
show_target("vig_arch_tar_visnetwork")
Target 'vig_arch_tar_visnetwork' requires tar_make() to build.
*`vig_arch_tar_visnetwork` requires `tar_make()` to render.*

Pipeline Telemetry

Dependency Graph

Target 'vig_pipeline_dependency_graph' requires tar_make() to build.

vig_pipeline_dependency_graph requires tar_make() to render.

Plans and Targets

Top 5 Targets by Storage Size

Top 5 Targets by Compute Time

Commit Velocity

Weekly commit frequency over the last 26 weeks. Each bar represents commits merged in a calendar week. Source: gert::git_log().

Issues and Pull Requests

Codebase Metrics

Reproducibility

Show code
sessionInfo()
R version 4.6.1 (2026-06-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 26.04 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] micromort_0.2.0

loaded via a namespace (and not attached):
 [1] base64url_1.4     jsonlite_2.0.0    compiler_4.6.1    tidyselect_1.2.1 
 [5] Rcpp_1.1.1-1.1    jquerylib_0.1.4   callr_3.8.0       yaml_2.3.12      
 [9] fastmap_1.2.0     R6_2.6.1          igraph_2.3.3      knitr_1.51       
[13] htmlwidgets_1.6.4 backports_1.5.1   targets_1.12.0    tibble_3.3.1     
[17] units_1.0-1       maketools_1.3.2   rprojroot_2.1.1   bslib_0.11.0     
[21] pillar_1.11.1     rlang_1.2.0       DT_0.34.0         cachem_1.1.0     
[25] xfun_0.59         sass_0.4.10       sys_3.4.3         otel_0.2.0       
[29] cli_3.6.6         magrittr_2.0.5    crosstalk_1.2.2   ps_1.9.3         
[33] digest_0.6.39     processx_3.9.0    secretbase_1.3.0  lifecycle_1.0.5  
[37] prettyunits_1.2.0 vctrs_0.7.3       evaluate_1.0.5    glue_1.8.1       
[41] data.table_1.18.4 codetools_0.2-20  buildtools_1.0.0  rmarkdown_2.31   
[45] tools_4.6.1       pkgconfig_2.0.3   htmltools_0.5.9