`make_weight()` creates weights coherently with an identity matrix, `x` and a matrix giving the quantities for each crop for one or several years. Called in `prepare_typology()`

make_weight(x, y, weight = TRUE, trim = 0)

Arguments

x

identity matrix indicating the correspondance between a crop typology and another.

y

matrix, quantity of each crop to be used to create weights.

weight

logical, should weights be applied to result. Should be set to FALSE to return a matrix filled with values of y coherently with correspondance. Default to TRUE.

trim

integer, argument passed to `mean()`, default to 0.

Value

matrix of weights.