settings_setFilePaths: Update FILE_PATHS in a CWatM settings 'list'

View source: R/modelSetupRun.R

settings_setFilePathsR Documentation

Update FILE_PATHS in a CWatM settings list

Description

/ This function updates the FILE_PATHS domain of a CWatM settings named list based on user-defined values.

Usage

settings_setFilePaths(
  settingsList,
  PathRoot = NULL,
  PathOut = NULL,
  PathMaps = NULL,
  PathMeteo = NULL
)

Arguments

settingsList

named list with CWatM settings

PathRoot

character; path to folder containing all CWatM datasets

PathOut

character; path to folder to save CWatM simulation's outputs

PathMaps

character; path to folder containing all input data (excluding meteorological varaibales)

PathMeteo

character; path to folder containing all meteorological variables

Details

The function updates the settings file FILE_PATHS domain allowing the user to define its own paths to the model data and outputs. By convention, both PathMaps and PathMeteo are sub-folders of PathRoot. Users are encourages to provide each of these argument with the full pat. if a sub-folder of PathRoot the function rewrites the path as: "$(PathRoot)/Path_to_data". Alternatively, the user can use the following format to provide a relative path: "./Path_to_data", whereas the "./" stands for the current working directory.

Value

named list; a CWatM settings list.

Examples

## Not run: 

# set workinf directory
setwd("d:/cwatm/model_data")

# load a settings file template to a named `list`
my_settings <- settings_ini2list(inipath = "./cwatm/settings_template.ini")

# set user-defined paths
root = "d:/cwatm/model_data"
maps = "d:/cwatm/model_data/maps"
meteo = "./climate"

my_settings <- settings_setFilePaths(settingsList = my_settings,
                                     PathRoot = root,
                                     PathOut = NULL,
                                     PathMaps = maps,
                                     PathMeteo = meteo)

## End(Not run)/

dof1985/cwatm4r documentation built on Nov. 8, 2022, 7:30 p.m.