dataPreparation {optimLanduse}R Documentation

Transform data into the expected format

Description

The input data must suit the specific expected optimLanduse format prior to initialization and optimization. This function provides the possibility to easily transform data from the commonly used form of the exemplary data exampleData into the expected format. Please consider that the application of this function is not mandatory and in most cases not required. Best practice is to transform your data yourself into the expected format. Detailed information about the expected format and possible data processing can be found on the GitHub project page. Note that incomplete rows, which include NA-values will be deleted and an error message will be thrown.

Usage

dataPreparation(dat, uncertainty = "SE", expVAL = "mean")

Arguments

dat

Data frame or tibble in the format of the exampleData. Please refer to the GitHub project page for more details.

uncertainty

Indicates the column name of the uncertainty measure. Typical is "SE" for standard error or "SD" for standard deviation.

expVAL

Indicates the column name of the expected value.

Value

A formatted coefficients table with land-use options and indicator values ready for initialization via initScenario.

References

Gosling, E., Reith, E., Knoke, T. et al. Exploring farmer perceptions of agroforestry via multi-objective optimisation: a test application in Eastern Panama. Agroforest Syst 94, 2003–2020 (2020). https://doi.org/10.1007/s10457-020-00519-0

Examples

require(readxl)
dat <- read_xlsx(exampleData("exampleGosling_dataPrep.xlsx"), col_names = TRUE)
dat <- dataPreparation(dat, uncertainty = "sd", expVAL = "mean")

[Package optimLanduse version 1.2.1 Index]