updateFarmData.RdThis function has been conceived with the Dutch FADN in mind, please use `fadn2fd()` for EU FADN data.
`updateFarmData()` creates sample farms by aggregating data based on the weighted mean and the selected mapping for use in FarmDyn. For non-numerical globals, it summarises based on the mode using the `Modes()` function. When `writegdx` is `TRUE`, it writes the GDX in the format 'farmData_(mapping).gdx'.
updateFarmData(
filename,
BINDir,
gdxmap,
mapping,
writegdx = TRUE,
cptcoeffs = FALSE,
farmchars = NULL,
cptcoeffsxl = NULL
)Name of the GDX file with BIN data and mappings.
Directory where the FADN data is located.
Name of the set in the GDX file that contains the mapping (e.g. Regs2BINID)
Column name of the characteristic/variable to be grouped by (e.g. "Regions" or "Regs")
Logical. If `TRUE`, it writes a GDX with the descriptive statistics.
Logical. When this is set to `TRUE` it calculates farm-specific parameters based on CPT coefficients
GDX file containing farm characteristics
Location of the CPT coefficients excel file
A tibble `tbl_df`.
gdxbinwiderWidens BIN data directly from GDX
gdxreshapeLengthens data and saves to GDX
wgdxWrite R data to GDX
wgdx.lstWrite multiple symbols to GDX
summariseSummarises data and aggregates to group
weighted.meanCalculates weighted mean