Skip to contents

Expands a per-crop/per-season rotation description (one row per crop in the sequence) into a monthly calendar covering n_years, cycling through the rotation and tracking sowing/harvest months, the active crop, and the previous/next crop in the sequence. This is the base calendar that the other expand_* functions (cover crops, eom application, irrigation, tillage) add to.

Usage

expand_rotation_calendar(
  df,
  sowing.var = "crop.sowing.date",
  harvest.var = "crop.harvest.date",
  start_year = 2020,
  n_years = 30
)

Arguments

df

Rotation data frame, one row per crop in the sequence (recycled over n_years), with at least the columns referenced by sowing.var/harvest.var plus crop.id.be.socmo, saison.culturale, and crop.residue.removal.

sowing.var

Name of the column in df holding the sowing date (format "MM-DD", only the month is used).

harvest.var

Name of the column in df holding the harvest date (format "MM-DD", only the month is used).

start_year

First simulation year.

n_years

Number of years to simulate.

Value

A data frame with one row per month (including a lead-in period before start_year sized to fit the full rotation), with columns including year, month, crop.id.be.socmo, prevcrop.id.be.socmo, nextcrop.id.be.socmo, rotation.cycle, active, sowing, harvest, and grp.crop.active.