`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()` 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
)

updateFarmData(
  filename,
  BINDir,
  gdxmap,
  mapping,
  writegdx = TRUE,
  cptcoeffs = FALSE,
  farmchars = NULL,
  cptcoeffsxl = NULL
)

Arguments

filename

Name of the GDX file with BIN data and mappings.

BINDir

Directory where the FADN data is located.

gdxmap

Name of the set in the GDX file that contains the mapping (e.g. Regs2BINID)

mapping

Column name of the characteristic/variable to be grouped by (e.g. "Regions" or "Regs")

writegdx

Logical. If `TRUE`, it writes a GDX with the descriptive statistics.

cptcoeffs

Logical. When this is set to `TRUE` it calculates farm-specific parameters based on CPT coefficients

farmchars

GDX file containing farm characteristics

cptcoeffsxl

Location of the CPT coefficients excel file

Value

A tibble `tbl_df`.

A tibble `tbl_df`.

See also

  • gdxbinwiderWidens BIN data directly from GDX

  • gdxreshapeLengthens data and saves to GDX

  • wgdxWrite R data to GDX

  • wgdx.lstWrite multiple symbols to GDX

  • summariseMake dataframes longer

  • weighted.mean]Calculates weighted mean

  • gdxbinwiderWidens BIN data directly from GDX

  • gdxreshapeLengthens data and saves to GDX

  • wgdxWrite R data to GDX

  • wgdx.lstWrite multiple symbols to GDX

  • summariseMake dataframes longer

  • weighted.mean]Calculates weighted mean

Examples