Read the documented directory-based crop inputs

Description

Read the documented directory-based crop inputs

Usage

read_crop_data(
  data_dir,
  crop,
  harvest_month,
  weather_variables = c("SLR", "PCP", "MAX", "MIN", "HMD", "DIF", "TAS")
)

Arguments

data_dir

Directory containing 'yield.csv', 'crop_areas.csv', and a 'weather' directory with one 'pl_<region>.dat' file per region.

crop

Crop column present in both yield and area files.

harvest_month

Final calendar month in the 12-month agricultural year.

weather_variables

Weather columns to use. All 12 monthly values are retained; variable selection is never performed by this function.

Value

An object of class 'crop_yield_data'.

Examples

wheat <- read_crop_data(poland_example_path(), "wheat", 7)
wheat

[Package yieldlag version 0.3.0 ]