Choose model asks the user inside the console for input. Options are Exit, New Model, or one of a list of existing models. If no integer number was presented by the user an ERROR message will be created but no ERROR will be thrown. This way this can be inserted inside a loop.

choose_model(rivermodels)

Arguments

rivermodels

A list of named models

Value

Returns the user input as character vector, or an ERROR message.

Examples

choose_model(list())
#> Exit: 'exit' #> New Model: 'new'Choose one option:
#> [1] "ERROR: could not read input \n"
choose_model(list(fake_river_model = 1))
#> Exit: 'exit' #> New Model: 'new' #> fake_river_model: '1'Choose one option:
#> [1] "ERROR: could not read input \n"