A bilingual, reproducible market-intelligence case study combining Canadian crop production, provincial farm prices and CAD/USD exchange rates in a temporary SQLite database.
Proyecto bilingüe y reproducible que integra producción agrícola canadiense, precios provinciales y tasas CAD/USD en una base SQLite temporal.
- Validates four dated source snapshots with explicit business rules.
- Builds and indexes SQLite during execution; no opaque database artifact is committed.
- Keeps parameterized SQL in versioned
.sqlfiles. - Publishes the same analytical layer in English and Spanish.
- Tests schemas, units, queries, indexes, failure cases and a procurement scenario.
- Renders the complete site in GitHub Actions and uploads it as an artifact.
- Latest national production comparison for barley, canola, rye and wheat.
- Long-run production trends for brewing and distilling grains.
- Transparent provincial coverage and national-share calculations.
- Saskatchewan barley prices expressed in CAD and USD per metric tonne.
- An auditable 250-tonne procurement sensitivity scenario.
Validated CSV snapshots
↓
Temporary indexed SQLite database
↓
Versioned parameterized SQL
↓
Tested R analytical functions
↓
Bilingual Quarto website
See the architecture and data dictionary for the full relational model and units.
.
├── R/analysis.R # validated analytical API
├── sql/ # parameterized SQL queries
├── data/ # preserved transparent snapshots
├── data-raw/prepare-data.R # validated snapshot refresh
├── docs/ # architecture and data dictionary
├── tests/testthat/ # automated tests
├── index.qmd # English report
├── es/index.qmd # Spanish report
└── .github/workflows/ # CI validation and render
Prerequisites: R 4.4+, Quarto 1.8+ and a working C/C++ build toolchain when required by R packages.
Rscript -e "if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')"
Rscript -e "renv::restore()"
Rscript tests/testthat.R
quarto renderRefreshing source snapshots is optional and occurs only when explicitly requested:
Rscript data-raw/prepare-data.RThe refresh script validates schemas before replacing committed files and writes row counts, file sizes and MD5 checksums to data/SNAPSHOT_METADATA.csv.
The course snapshots originate from Statistics Canada materials distributed through the IBM Skills Network. Exact URLs and the snapshot date are recorded in data/SOURCES.txt. The analytical site is historical and does not claim to provide current prices or inventory.
- Original learning publication: RPubs
- English report:
index.qmd - Reporte en español:
es/index.qmd
Farm price multiplied by volume is not delivered cost. Freight, quality grades, storage, basis, hedging, financing, taxes and negotiated contract terms are deliberately excluded and documented.
Code is released under the MIT License. Source datasets retain their original terms.