Skip to contents

MineSDG v0.4.0 turns the site KPI engine into a reporting engine. Instead of chaining calculate_*() primitives, one call produces a framework report:

rep <- generate_gri_report(demo_mine_sites, site_id = "CU-ATAC",
                           years = 2022:2024)
rep
#> == MineSDG GRI Report ==
#> Site: CU-ATAC | Reporting year: 2024 
#> Composite: 66.8 / 100 | Grade: C 
#> Disclosures: 25 | reported: 19 | narrative pending: 5 | mandatory coverage: 77.3% 
#> Render with render_minesdg_report(); export tables with write_report_xlsx().
#> Version: 0.4.0 | crosswalk: gri:2021+g11:2022/map-v1

The disclosure bundle

Every report is built from a disclosure bundle – the only interface between the scoring engine and the reporting layer:

Mine KPI Data -> KPI Engine -> Score Engine -> Disclosure Bundle
  -> Framework Mapping -> Report Generator

compile_site_disclosures() runs score_site_sdg() once per year and assembles KPI values, scores, validated raw inputs, year-on-year deltas and your narrative text. Report generators never call KPI calculators directly, which guarantees a single source of truth and zero duplicate calculations.

bundle <- compile_site_disclosures(
  demo_mine_sites, site_id = "CU-ATAC", years = 2022:2024,
  narratives = list(
    nar_water_mgmt = "Site water is managed under a catchment-level
      stewardship plan with quarterly community review."),
  entity_meta = list(company = "Atacama Copper SpA"))
bundle
#> == MineSDG Disclosure Bundle ==
#> Site: CU-ATAC - Atacama Copper 
#> Years: 2022, 2023, 2024 | Reporting year: 2024 
#> Composite (2024): 66.8 / 100  |  Grade: C
#> KPIs per year: 14 | Raw fields: 21 
#> Narrative slots supplied: 1

bundle_kpi(bundle, "ghg_intensity")
#> [1] 47.43
bundle_raw(bundle, "ghg_scope1_t")
#> [1] 640035
bundle_score(bundle, "goal_8")
#> [1] 86.3

Framework mappings are data

Each framework ships as a crosswalk dataset with a shared schema. Adding or amending a disclosure means editing data (data-raw/make_crosswalks.R), not code:

framework_crosswalk("gri")[1:6, c("disclosure_id", "disclosure_title",
                                  "source_type", "source_id")]
#>    disclosure_id                             disclosure_title source_type
#>           <char>                                       <char>      <char>
#> 1:         302-1   Energy consumption within the organization         raw
#> 2:        302-1b        Renewable share of energy consumption         raw
#> 3:         302-3                             Energy intensity         kpi
#> 4:         303-1 Interactions with water as a shared resource   narrative
#> 5:         303-3                             Water withdrawal         raw
#> 6:         303-4                              Water discharge         raw
#>               source_id
#>                  <char>
#> 1:            energy_gj
#> 2: renewable_energy_pct
#> 3:     energy_intensity
#> 4:       nar_water_mgmt
#> 5:  water_withdrawal_m3
#> 6:   water_discharge_m3

The generic mapper resolves every disclosure to a value and an honest status – reported, partial, narrative_provided, narrative_required or not_in_scope. Reports never fabricate:

m <- map_bundle_to_framework(bundle, "gri")
m
#> == MineSDG Framework Mapping: GRI ==
#> Site: CU-ATAC | Reporting year: 2024 
#> Disclosures: 25 
#>   reported: 19 | partial: 0 | narrative provided: 1 | narrative required: 4 | not in scope: 1
#> Mandatory coverage: 18 / 22 (81.8%)

GRI

generate_gri_report() covers GRI 302, 303, 304, 305, 306, 403 and 413, and produces the content index assurance teams ask for:

head(gri_content_index(rep), 8)
#>   disclosure_id                             disclosure_title             status
#> 1         302-1   Energy consumption within the organization           reported
#> 2        302-1b        Renewable share of energy consumption           reported
#> 3         302-3                             Energy intensity           reported
#> 4         303-1 Interactions with water as a shared resource narrative_required
#> 5         303-3                             Water withdrawal           reported
#> 6         303-4                              Water discharge           reported
#> 7         303-5                            Water consumption           reported
#> 8         303-R                         Water recycling rate           reported
#>                     source              omission_reason
#> 1            raw:energy_gj                             
#> 2 raw:renewable_energy_pct                             
#> 3     kpi:energy_intensity                             
#> 4 narrative:nar_water_mgmt Narrative disclosure pending
#> 5  raw:water_withdrawal_m3                             
#> 6   raw:water_discharge_m3                             
#> 7      kpi:water_intensity                             
#> 8 kpi:water_recycling_rate

ICMM

generate_icmm_report() adds a board scorecard, a traffic-light assessment (a pure reclassification of existing 0-100 KPI scores) and data-driven recommendations from icmm_recommendation_rules:

icmm <- generate_icmm_report(demo_mine_sites, site_id = "CU-ATAC",
                             years = 2023:2024)
icmm$extras$traffic_lights[, c("kpi_id", "value", "score", "light")]
#>                       kpi_id   value score  light
#>                       <char>   <num> <num> <char>
#>  1:           tailings_ratio  0.9830   4.3    red
#>  2:     water_recycling_rate 40.8300  37.9    red
#>  3:    female_employment_pct 21.1000  64.4  amber
#>  4:  land_rehabilitation_pct 56.5200  66.5  amber
#>  5: community_investment_pct  1.0140  66.5  amber
#>  6:            ghg_intensity 47.4300  69.1  amber
#>  7:         energy_intensity  0.4722  69.3  amber
#>  8:         waste_rock_ratio  2.6780  76.0  green
#>  9:     local_employment_pct 66.2000  77.0  green
#> 10:          water_intensity  0.8760  77.3  green
#> 11:                    ltifr  1.0420  82.2  green
#> 12:                    trifr  2.9760  85.9  green
#> 13:     renewable_energy_pct 40.1000 100.0  green
#> 14:            fatality_rate  0.0000 100.0  green
icmm$extras$recommendations[, c("principle", "recommendation")]
#>      principle
#>         <char>
#> 1: Principle 6
#> 2: Principle 6
#>                                                                                                        recommendation
#>                                                                                                                <char>
#> 1: Invest in water recirculation: thickened-tailings water recovery and process-water reuse to raise recycling rates.
#> 2:        Review tailings minimisation options (ore sorting, coarse particle recovery) and confirm GISTM conformance.

BRSR

The SEBI BRSR generators reuse the same bundle. Supply entity_meta$fx_usd_inr to convert monetary lines to INR lakh – without it, those lines are flagged partial/not_in_scope rather than estimated:

kpis <- generate_brsr_kpis(
  demo_mine_sites, site_id = "CO-JHAR", years = 2023:2024,
  entity_meta = list(fx_usd_inr = 83.2))
kpis[, c("disclosure_id", "disclosure_title", "value", "status")]
#>     disclosure_id                  disclosure_title        value       status
#>            <char>                            <char>        <num>       <char>
#>  1:  BRSR-C-P2-E1 Resource efficiency in production 3.265000e-01     reported
#>  2:  BRSR-C-P3-E1          Safety incidents (TRIFR) 5.655000e+00     reported
#>  3:  BRSR-C-P3-E2        Lost-time injuries (LTIFR) 1.562000e+00     reported
#>  4:  BRSR-C-P3-E3                        Fatalities 0.000000e+00     reported
#>  5:  BRSR-C-P3-L1                Training intensity           NA not_in_scope
#>  6:  BRSR-C-P5-E1               Workforce diversity 1.960000e+01     reported
#>  7:  BRSR-C-P6-E1                Energy consumption 9.339240e+06     reported
#>  8: BRSR-C-P6-E1b            Renewable energy share 3.310000e+01     reported
#>  9:  BRSR-C-P6-E2                  Water withdrawal 1.375359e+07     reported
#> 10: BRSR-C-P6-E2b                   Water recycling 3.709000e+01     reported
#> 11:  BRSR-C-P6-E3           GHG emissions (Scope 1) 1.394212e+06     reported
#> 12: BRSR-C-P6-E3b           GHG emissions (Scope 2) 7.507290e+05     reported
#> 13: BRSR-C-P6-E3c                     GHG intensity 7.499000e+01     reported
#> 14:  BRSR-C-P6-E4                   Waste generated 1.003739e+05     reported
#> 15:  BRSR-C-P6-L1               Land rehabilitation 6.108000e+01     reported
#> 16:  BRSR-C-P8-E1             CSR / community spend 1.414000e+00     reported
#> 17:  BRSR-C-P8-E2                  Local employment 6.530000e+01     reported
#> 18:  BRSR-C-P8-L1                 Local procurement           NA not_in_scope

generate_brsr_report(), generate_brsr_sectionA() and generate_brsr_sectionB() are views over the same single mapping computation.

Rendering

Reports are plain R objects; rendering is optional and gated on Suggests packages:

# HTML / PDF / DOCX via the packaged Quarto templates
render_minesdg_report(rep, "gri_2024.html", format = "html")
render_minesdg_report(rep, "gri_2024.pdf",  format = "pdf")

# Styled Excel workbook of the disclosure tables
write_report_xlsx(rep, "gri_2024.xlsx")

# One-liner: generate and render together
generate_brsr_report(demo_mine_sites, site_id = "CO-JHAR",
                     years = 2023:2024, output = "brsr.docx",
                     format = "docx")

Portfolio and radar views

score_portfolio_sdg(demo_mine_sites)[year == 2024]
#>    site_id       site_name commodity country  year composite_score  grade
#>     <char>          <char>    <char>  <char> <int>           <num> <char>
#> 1: FE-PILB    Pilbara Iron  Iron Ore     AUS  2024            82.9      B
#> 2: BX-ODIS  Odisha Bauxite   Bauxite     IND  2024            82.7      B
#> 3: CO-JHAR     Jharia Coal      Coal     IND  2024            70.5      B
#> 4: ZN-RAJA  Rajasthan Zinc      Zinc     IND  2024            68.5      C
#> 5: CU-ATAC  Atacama Copper    Copper     CHL  2024            66.8      C
#> 6: AU-KALG Kalgoorlie Gold      Gold     AUS  2024            62.1      C
plot_sdg_radar(bundle)

The dashboard (run_minesdg_dashboard()) exposes the same functions interactively, including new Benchmark and Radar tabs.