Generates a menu of insurance options (none, group/area, individual/APH)
for a given farm dataset, year, and desired protection levels.
simulate_menu_revenue_fcip(
year = 2011,
farmdata,
menu_option,
farm_identifiers = NULL,
control = rfcipPackage_controls()
)Numeric scalar giving the target insurance crop year (e.g. 2024). Default is 2011.
A data.table of farm-level input. contain at least all columns required by rfcipCalcPass::fcip_calculator()
A data.frame or data.table Basic FCIP Menu Options constructed with
construct_menu_option_fcip_basic().
column name(s) that uniquely identify each record/farm/producer. If NULL, a "producer_id" column is created.
List. A list of control parameters, typically created using
rfcipCalcPass::rfcipPackage_controls(), to manage internal behavior and data sourcing.
A data.table:
Each row corresponds to one farm & unit structure, insurance plan, coverage type, and coverage level combination, with
columns for premium rate, subsidy rate, user defind farm identifier in farm_identifiers
and all fields in rfcipCalcPass::FCIP_INSURANCE_POOL and rfcipCalcPass::FCIP_INSURANCE_ELECTION.
Internally this:
Ensures farmdata is a data.table and tags it with commodity_year.
Creates a producer_id if no identifiers provided.
Checks for required columns (rate_yield, approved_yield, FCIP_INSURANCE_POOL) and errors out if missing.
Builds the none menu (zero premium & full subsidy).
If "group" requested, pulls area-based rating data (using different datasets for 2011-2016 vs. 2017+), averages rates, merges in index values and subsidy percentages, and computes final premium & subsidy.
If "individual" requested, pulls APH eligibility & rate-differential tables, reshapes to unit structures (OU/BU/EU), then calls rfcipCalcPass::fcip_calculator() per election to compute premium & subsidy.
Binds all selected menus together and returns the combined table.
Other FCIP Menu Calibration:
construct_menu_option_fcip()