Data Appendix
Every dataset used in this book, in one place. The files live in the book’s practice/data/ folder; click a file name to download it. Put downloaded files in your own project’s data/ folder, untouched, and do all your work in a script.
The datasets fall into two groups. The first group is real data, drawn from the agencies cited with each entry. The second group is synthetic data constructed for this course; those files look like real farm records but the values are generated, so nothing in them describes an actual farm.
Real datasets
Saskatchewan RM crop yields
Average yields for every Saskatchewan Rural Municipality. Source: Saskatchewan Crop Insurance Corporation (2025a).
rm_yields_1990_2025.csv– the long form: 71,104 rows, one per RM-year-crop, for eight crops from 1990 to 2025. ColumnsYear,RM,Crop,Yield,Unit. Lentils are recorded in pounds per acre and every other crop in bushels per acre; theUnitcolumn says which. Used in the Module 1 and Module 2 test banks.rm_canola_yields_1990_2025.csv– the canola rows only, for the Module 2 test bank’s summary-statistics questions.rm_yields_1990plus.csv– the wide form: 10,649 rows, one per RM-year, with one column per crop. Used in Module 1, where the wide layout suits PivotTables.rm_yields_2015_2024.csv– a wide subset (2,950 rows, ten years, six crops) used in Modules 3 and 4.
Saskatchewan variety yields
Variety-level yields and acres by SCIC risk zone. Source: Saskatchewan Crop Insurance Corporation (2025b).
sask_variety_yields.csv– 14,700 rows, one per risk-zone-crop-variety-year, risk zones 1 to 23, 2021 to 2025. ColumnsRisk_Zone,Crop,Variety,Year,Acres,Yield. Suppressed observations have missing acres and yield. The charts in Module 4 and the AI exercises in Module 5 are built from this file.sask_barley_2025.xlsx/sask_barley_2025.csv– 2025 barley varieties, provincial acres and average yield. The workbook version has the title rows and multiple sheets that Module 3’s Excel-import section works through.
Manitoba wheat variety yields
MASC’s variety-level spring wheat yields by municipality, 2020 to 2025. Source: Manitoba Agricultural Services Corporation (2025).
mb_wheat_varieties.csv– 5,358 rows, one per municipality-variety-year. ColumnsYear,Municipality,Variety,Farms,Acres,Yield_bu_ac,Reported. Where too few farms grew a variety the row is suppressed for privacy:Reportedis FALSE and the numeric columns are missing. Used in the Module 1 and Module 2 test banks.mb_wheat_reported_2020_2025.csv– the 2,398 reported rows only.
Canada field crops
Statistics Canada’s provincial estimates of seeded area and yield. Source: Statistics Canada (2025).
statcan_field_crops.csv– 1,067 rows, one per province-crop-year, thirteen crops from 2015 to 2025. ColumnsYear,Province,Crop,Seeded_acres,Yield_bu_ac. Used in the Module 1 and Module 2 test banks.statcan_spring_wheat_2015_2025.csv– the 94 spring wheat rows only.
RM lookup table
rm_lookup.csv– one row per Saskatchewan RM (296 rows): name, census division, 2021 population, and the nearest of sixteen weather stations with its distance. Compiled for this course from Statistics Canada 2021 Census counts. Used in Module 3’s merging chapter.
Station precipitation
station_precip.csv– May-to-August precipitation for sixteen Saskatchewan weather stations, 2015 to 2024 (160 rows), with a count of days missing a reading. Compiled from Environment and Climate Change Canada historical climate records. Used in Module 3’s merging chapter.
Synthetic datasets
Canola trial
canola_trial.csv– 120 canola fields with fertilizer rate, growing-season rainfall, variety, and yield. Three fields have missing rainfall values, on purpose. This is the running example in Module 2’s data chapters and returns in Modules 3 and 7.
Field yields
field_yields.csv– sixty hypothetical canola fields with region, variety, acres, yield, and seeding date.
Saskatchewan wheat fields, 2025
sask_wheat_2025.csv– field-level wheat records with soil zone, variety, acres, yield, protein, and seeding rate. Constructed for the course; the soil-zone yield differences are patterned on real ones. Used in Module 6’s reporting examples and the Module 2 practice pages.
Grain deliveries (messy)
grain_deliveries_messy.csv– elevator delivery tickets constructed to contain the problems Module 3’s cleaning chapter works through: inconsistent crop names, stray spaces, impossible values, duplicates.
Elevator tickets
elevator_tickets.csv/elevator_tickets_semicolon.csv– the same small set of delivery tickets saved with comma and semicolon delimiters, for Module 3’s file-formats section.
Crop prices
crop_prices.csv– a handful of illustrative crop prices used in Module 5’s examples. Not market data.