All functions

abs_diff()

Calculates the absolute difference of the reference and the scenarios in a new column

fadn2fd()

`fadn2fd()` imports the FADN data from the csv files

fd_desc()

`fd_desc()` calculates the descriptive statistics of the farm data

first_match_col()

`first_match_col()` finds the first matching column in a dataframe

gdxbinwider()

Join BIN data together, make joined dataset wider, and group by a mapping

gdxload()

Load from GDX

gdxreshape()

Reshape from wide to long and save to GDX

groupstats()

Generate descriptive statistics and save to GDX

is.nan(<data.frame>)

`is.nan.data.frame()` checks if there are any NaNs in a dataframe (`is.nan()` does not work for dfs)

load_dumps()

`load_dumps()` loads the p_res from the dump gdx files

load_dump_marg()

`load_dump_marg()` loads any marginal from the dump gdx files

load_dump_par()

`load_dump_par()` loads any parameter from the dump gdx files

load_dump_scalar()

`load_dump_scalar()` loads any scalar from the dump gdx files

Modes()

Retrieve mode of vector

replace_first_match_col()

`replace_first_match_col()` replaces the name of the column in `first_match_col()` with what the user inputs

rgdx.var()

Improved function to load variables from gdx files (from Renger in GAMSWorld forum)

rm_lown()

`rm_lown()` removes aggregated farms with less than 15 farms for reporting

runFarmDynfromBatch()

Execute FarmDyn

scen_analysis()

Data analysis function for repeated tasks This loads p_res from different scenarios

scen_diff()

Calculates the relative difference of the reference and the scenarios in a new column

str_line_replace() str_firstLine_replace() str_lastLine_replace()

Replace first or last line in strings

updateFarmData()

Reshape from wide to long and save to GDX Create sample farms

vars_dump()

Load variables from dump gdx files and return a data.table

writeBatch()

Write batch file for batch file execution mode in FarmDyn