Skip to contents

Load all data necessary to perform analysis

Usage

load_data(
  case,
  path_input,
  path_output = getOption("floodam.cba.sa")[["path_output"]],
  n = 1000,
  type_input = getOption("floodam.cba.sa")[["type_input"]],
  rate = getOption("floodam.cba.sa")[["rate"]],
  check = getOption("floodam.cba.sa")[["check"]],
  verbose = getOption("floodam.cba.sa")[["verbose"]]
)

Arguments

case

character, name of the case study.

path_input

character, path where to find input data.

path_output

character, path where to save output data.

n

integer, path where to save output data.

type_input

character, format of input.

rate

character, parameter to choose discount rate.

check

logical, should input data be checked.

verbose

logical, should the function be verbose.

Value

list of all input data and useful paths.

Details

load_data() loads all data necessary to perform analysis. It defines also some key parameters such as where to save outputs, how many draws should be done for uncertainty analysis, what should be the discount rate.

load_data() can also make some checks on the format of inputs, to ensure that everything will work fine when applying analysis. If some checks are not passed, a message is given to help correct problems.

Author

Frédéric Grelot, frederic.grelot.1994_cran@m4x.org

Examples


case = "test"
path_input = system.file("extdata", package = "floodam.cba.sa")

# minimum information given
input = load_data(case, path_input)
#> Case 'test' successfully loaded.
#> Key informations are:
#> 	- 'floodam.cba.sa' in version 1.0.1.0 is used with:
#> 		- n=1000
#> 		- rate=constant
#> 	- 'sensitivity' in version 1.30.1 is used.
#> 	- input are taken from '/tmp/RtmpXW9CLS/temp_libpathf4133c3201f/floodam.cba.sa/extdata/test'
#> 	- output are saved in '/tmp/RtmpYZgRIB/test'

# without any message
input = load_data(case, path_input, verbose = FALSE)

# readjusting
input = load_data(case, path_input, n = 100)
#> n too small, modified to 1000
#> Case 'test' successfully loaded.
#> Key informations are:
#> 	- 'floodam.cba.sa' in version 1.0.1.0 is used with:
#> 		- n=1000
#> 		- rate=constant
#> 	- 'sensitivity' in version 1.30.1 is used.
#> 	- input are taken from '/tmp/RtmpXW9CLS/temp_libpathf4133c3201f/floodam.cba.sa/extdata/test'
#> 	- output are saved in '/tmp/RtmpYZgRIB/test'