This function calculates crop growing seasons using climate variables processed by weighted_climate along with crop calendars for both historical and projected periods. This function prepares climate and yield data for subsequent model fitting.
Arguments
- climate_hist_dir
Default = NULL. String for path to the processed historical climate data folder
- climate_impact_dir
Default = NULL. String for path to the processed future climate data folder using weighted_climate function
- climate_model
Default = NULL. String for climate model (e.g., 'CanESM5')
- climate_scenario
Default = NULL. String for climate scenario (e.g., 'ssp245')
- historical_periods
Default = NULL. Vector for years to subset from the historical climate data. If NULL, use the default climate data period
- crop_calendar_file
Default = NULL. String for the path of the crop calendar file. If crop_calendar_file is provided, crop_select will be set to crops in crop calendar. User provided crop_calendar_file can include any crops MIRCA2000 crops: "wheat", "maize", "rice", "barley", "rye", "millet", "sorghum", "soybean", "sunflower", "root_tuber", "cassava", "sugarcane", "sugarbeet", "oil_palm", "rape_seed", "groundnuts", "pulses", "citrus", "date_palm", "grapes", "cotton", "cocoa", "coffee", "others_perennial", "fodder_grasses", "others_annual"
- start_year
Default = NULL. Integer for the start year of the projected data
- end_year
Default = NULL. Integer for the end year of the projected data
- co2_hist
Default = NULL. Data table for historical CO2 concentration in columns [year, co2_conc]. If NULL, use built-in CO2 emission data
- co2_proj
Default = NULL. Data table for projected CO2 concentration in columns [year, co2_conc]. If NULL, use built-in CO2 emission data
- output_dir
Default = file.path(getwd(), 'output'). String for output directory