| Title: | Indian Farm Cost Concepts for Agricultural Economic Analysis |
|---|---|
| Description: | Implements commonly used Indian farm cost concepts for agricultural economic analysis, including Cost A1, A2, B1, B2, C1, C2, and C3. Tools are provided to calculate cost concepts from farm-level input data, aggregate costs across groups, summarize distributions, compute returns and benefit-cost ratios, estimate cost of production and break-even values, decompose cost shares, conduct one-way sensitivity analysis, and visualize concept-wise costs. The implementation is designed for reproducible farm management and cost-of-cultivation studies. |
| Authors: | Chiranjit Mazumder [aut, cre], Mrinmoy Ray [aut], Utkarsh Tiwari [aut] |
| Maintainer: | Chiranjit Mazumder <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-10-11 10:08:03 UTC |
| Source: | https://github.com/cran/IndFarmCost |
Calculates the frequently reported A2 plus family labour measure from a
farmcost object.
a2_plus_fl(x)a2_plus_fl(x)
x |
An object returned by |
A numeric vector equal to A2 plus imputed family labour.
Calculates the main-product price required to cover a selected cost concept, after crediting by-product value.
break_even_price(x, yield, concept = "C2", byproduct_value = 0)break_even_price(x, yield, concept = "C2", byproduct_value = 0)
x |
An object returned by |
yield |
Main-product yield as a column name, scalar, or vector. |
concept |
Cost concept used for break-even analysis. |
byproduct_value |
By-product value credited against cost. |
A numeric vector of break-even prices.
Calculates the main-product yield required to cover a selected cost concept, after crediting by-product value, at a specified product price.
break_even_yield(x, price, concept = "C2", byproduct_value = 0)break_even_yield(x, price, concept = "C2", byproduct_value = 0)
x |
An object returned by |
price |
Main-product price as a column name, scalar, or vector. |
concept |
Cost concept used for break-even analysis. |
byproduct_value |
By-product value credited against cost. |
A numeric vector of break-even yields.
Provides a compact table describing the cost concepts implemented by the package.
concept_definitions()concept_definitions()
A data frame with concept, formula, and interpretation.
Calculates unit cost as the selected cost concept less by-product value, divided by main-product yield.
cost_of_production(x, yield, concept = "C2", byproduct_value = 0)cost_of_production(x, yield, concept = "C2", byproduct_value = 0)
x |
An object returned by |
yield |
Main-product yield as a column name, scalar, or vector. |
concept |
Cost concept used in the numerator. One of A1, A2, B1, B2, C1, C2, or C3. |
byproduct_value |
By-product value as a column name, scalar, or vector. Defaults to zero. |
A numeric vector of cost per unit of main product.
Changes one raw cost input by a series of proportional changes and reports the mean A1 through C3 under each scenario.
cost_sensitivity(data, variable, changes = c(-0.2, -0.1, 0, 0.1, 0.2), ...)cost_sensitivity(data, variable, changes = c(-0.2, -0.1, 0, 0.1, 0.2), ...)
data |
Raw input data frame accepted by |
variable |
Name of one numeric input column to vary. |
changes |
Numeric vector of proportional changes. For example, |
... |
Additional arguments passed to |
A data frame with the scenario change and mean cost concepts.
Returns a small deterministic farm-level dataset suitable for examples, teaching, and testing. Monetary values are illustrative Indian rupees per hectare and do not represent an official survey.
farm_cost_example()farm_cost_example()
A data frame with 12 farm observations and standard cost components.
Calculates Cost A1, A2, B1, B2, C1, C2, and C3 for each row of a farm-level data frame.
farm_costs( data, a1_cols = standard_a1_components(), a1_col = NULL, rent_leased_land = "rent_leased_land", interest_fixed_capital = "interest_fixed_capital", rental_value_owned_land = "rental_value_owned_land", family_labour = "family_labour", managerial_rate = 0.1, na.rm = FALSE, keep_inputs = TRUE )farm_costs( data, a1_cols = standard_a1_components(), a1_col = NULL, rent_leased_land = "rent_leased_land", interest_fixed_capital = "interest_fixed_capital", rental_value_owned_land = "rental_value_owned_land", family_labour = "family_labour", managerial_rate = 0.1, na.rm = FALSE, keep_inputs = TRUE )
data |
A data frame containing farm cost components. |
a1_cols |
Character vector naming columns to sum for Cost A1. By default,
|
a1_col |
Optional name of a pre-computed A1 column. If supplied,
|
rent_leased_land |
Column name, scalar, or numeric vector for rent paid for leased-in land. |
interest_fixed_capital |
Column name, scalar, or numeric vector for interest on owned fixed capital excluding land. |
rental_value_owned_land |
Column name, scalar, or numeric vector for the imputed rental value of owned land. |
family_labour |
Column name, scalar, or numeric vector for the imputed value of family labour. |
managerial_rate |
Non-negative managerial charge rate used for C3. The default is 0.10, so C3 equals 110 percent of C2. |
na.rm |
Logical. If |
keep_inputs |
Logical. If |
An object of class farmcost and data.frame containing the seven
cost concepts.
Aggregates A1 through C3 by one or more grouping variables using the mean, median, or sum. Weighted means are supported.
farm_costs_aggregate( x, by, method = c("mean", "median", "sum"), weights = NULL, na.rm = TRUE )farm_costs_aggregate( x, by, method = c("mean", "median", "sum"), weights = NULL, na.rm = TRUE )
x |
An object returned by |
by |
Character vector naming grouping columns. |
method |
One of |
weights |
Optional column name or numeric vector of non-negative weights.
Weights are allowed only when |
na.rm |
Logical indicating whether missing values should be removed. |
A data frame with grouping columns and aggregated A1 through C3.
Computes gross return, net return over each cost concept, and gross-return to cost ratios. Gross return may be supplied directly or calculated from main and by-product quantities and prices.
farm_returns( x, gross_return = NULL, main_output = NULL, main_price = NULL, byproduct_output = NULL, byproduct_price = NULL )farm_returns( x, gross_return = NULL, main_output = NULL, main_price = NULL, byproduct_output = NULL, byproduct_price = NULL )
x |
An object returned by |
gross_return |
Optional gross return as a column name, scalar, or vector. |
main_output, main_price
|
Main-product quantity and price, each supplied as a column name, scalar, or vector. |
byproduct_output, byproduct_price
|
Optional by-product quantity and price. If omitted, by-product value is treated as zero. |
A data frame containing gross return, net returns, and benefit-cost ratios for A1 through C3.
Plots A1 through C3 for one observation or the column means across all observations.
## S3 method for class 'farmcost' plot(x, row = 1L, type = c("bar", "line"), main = NULL, ylab = "Cost", ...)## S3 method for class 'farmcost' plot(x, row = 1L, type = c("bar", "line"), main = NULL, ylab = "Cost", ...)
x |
An object returned by |
row |
Row number to plot. Use |
type |
Either |
main |
Plot title. |
ylab |
Y-axis label. |
... |
Additional graphical arguments passed to |
The plotted values, invisibly.
Print a Farm Cost Object
## S3 method for class 'farmcost' print(x, ...)## S3 method for class 'farmcost' print(x, ...)
x |
An object returned by |
... |
Arguments passed to |
The input object, invisibly.
Returns the default column names used by farm_costs() to construct Cost A1.
standard_a1_components()standard_a1_components()
A character vector of standard A1 component names.
Computes descriptive statistics for A1 through C3.
summarize_costs(x, na.rm = TRUE) ## S3 method for class 'farmcost' summary(object, ...)summarize_costs(x, na.rm = TRUE) ## S3 method for class 'farmcost' summary(object, ...)
x |
An object returned by |
na.rm |
Logical indicating whether missing values should be removed. |
object |
An object returned by |
... |
Additional arguments passed to |
A data frame with sample size, mean, standard deviation, minimum, quartiles, maximum, and coefficient of variation.
A data frame of descriptive statistics.