Skip to contents

Launch a PTI app

Entry points that scaffold a project and serve the Shiny dashboard.

create_new_pti()
Scaffold a new PTI app project
launch_pti()
Launch a multi-tab PTI Shiny app
launch_pti_onepage()
Launch a single-page PTI Shiny app

Calculation pipeline

Compute scores, label outputs, and compile deployment artefacts.

compile_pti_data()
Compile PTI deployment artefacts from intermediate files
generic_pti_glue()
Default glue template for PTI map popups
label_generic_pti()
Apply a glue-template `pti_label` column to per-admin PTI tibbles
run_pti_pipeline()
Run the full PTI calculation pipeline

Data input

Read shapes and metadata workbooks from disk.

aggregate_hex_to_shapes()
Aggregate hex-level indicator data to administrative shapes
build_hex_metadata()
Build the hex-pipeline metadata Excel workbook
fct_template_reader()
Read a PTI metadata Excel template into the package's list-of-tibbles format
fetch_hex_data()
Fetch hex-level indicator data from registry parquet endpoints
get_available_years()
Query a parquet endpoint for the actual available years of a variable
get_shape()
Load admin-level shape data for a PTI app
list_hex_vars()
List the bundled hex variables available for the PTI pipeline
make_admin_lookup()
Build the parent-child P-code cascade for a shapefile list
make_hex_grid()
Build an H3 hexagonal grid covering a country boundary
pti_patch_admin_sheet()
Patch an administrative metadata sheet with supplied indicator values
use_hex_vars()
Resolve hex variable names against the registry

Weighting schemes

Build weight sets passed to the calculation pipeline.

get_all_weights_combs()
Enumerate all weighting-scheme combinations of a given size
get_min_admin_wght()
Reduce per-scheme weights to the admin levels that must be hidden
get_rand_weights()
Generate a random list of weighting schemes

Data export

Bundle scores and weight tables for the dashboard’s download buttons.

get_pti_scores_export()
Reshape PTI scores into per-admin-level export tibbles
get_pti_weights_export()
Reshape weight schemes into a single export tibble
get_vars_un_avbil()
Identify (variable, admin-level) pairs with no native data

Input validation

Structural and visual checks on shapes and metadata inputs.

app_validate_metadata()
Standalone validation app – geometry + metadata + Data Explorer
app_validate_shp()
Visual shapefile inspector for PTI deployers
drop_inval_adm()
Strip unplottable admin levels out of a pre-plot data structure
mod_drop_inval_adm()
Drop-invalid-admin module server
validate_geometries()
Validate every geometry layer in a shapes list
validate_metadata()
Verify that a shapes file and metadata file together produce valid PTI scores
validate_read_metadata()
Validate a metadata `.xlsx` file in isolation
validate_read_shp()
Validate a shapes `.rds` file in isolation

Report helpers

ggplot2 and reactable helpers for the deployer-facing pipeline report (arch-13 §C).

pti_plot_boundaries()
Plot administrative boundary layers by level
pti_plot_histogram()
Plot a histogram for a PTI variable
pti_summary_table()
Summarise PTI variables in a reactable table

Visualisation helpers

ggplot2-based map builders shared by the dashboard and the PDF render.

gg_admin_list()
Build a list of ggplot maps from PTI admin data

Shiny modules

The reactive building blocks behind launch_pti().

mod_dta_explorer2_server()
Data-explorer page server module
mod_dta_explorer2_ui()
Data-explorer page UI
mod_leaf_side_panel_ui()
Map side-panel UI for a PTI page
mod_map_pti_leaf_ui()
Map container UI for PTI page modules
mod_plot_pti2_srv()
Main PTI map orchestration module
mod_pti_comparepage_newsrv()
Comparison-page server module
mod_pti_comparepage_ui()
Comparison-page UI for two side-by-side PTI maps
mod_ptipage_newsrv()
Page-level PTI server module
mod_ptipage_twocol_ui() mod_ptipage_box_ui()
Two-column UI for a PTI page
mod_tab_open_first_newserv()
Tab-opening invalidator for custom PTI page layouts

Package utilities

golem boilerplate and resource resolvers.

app_sys()
Resolve a path inside the installed devPTIpack package
golem_add_external_resources()
Bundle external resources for a PTI Shiny app

Bundled sample data

Datasets ready to feed the pipeline. Rwanda for user-facing examples; Ukraine for the test suite.

rwa_mtdt_full
Rwanda sample PTI metadata input
rwa_shp
Rwanda sample administrative boundaries
ukr_mtdt_full
Ukraine sample PTI metadata input
ukr_shp
Ukraine sample administrative boundaries