Harmonize harvest dates
harmonize_harvest_dates.RdDoes some light processing of the harvest_dates table.
Usage
harmonize_harvest_dates(
harvest_dates = NULL,
crop_fractions_as_columns = FALSE,
primary_crop_fractions = getOption("drivesR.primary_crop_fractions")
)Arguments
- harvest_dates
A data frame of the harvest_dates table from the DRIVES database. If NULL, this table is downloaded from Directus.
- crop_fractions_as_columns
If TRUE, multiple fractions from the same crop are organized in separate columns. If FALSE, multiple fractions from the same crop are organized in separate rows, as in the database table. Although multiple crop fractions are rare, this option helps to merge with the yield data.
- primary_crop_fractions
A vector of crop fractions to select as the primary fraction, when there is more than one. So far, this only pertains to grain and tomato fruit. The default is set with the option drivesR.primary_crop_fractions.