create_input_config: Creates either an empty configuration or a pre-filled...

View source: R/config_handling.R

create_input_configR Documentation

Creates either an empty configuration or a pre-filled configuration object from a config file

Description

Creates either an empty configuration or a pre-filled configuration object from a config file

Usage

create_input_config(config_file = NA)

Arguments

config_file

the path to a valid configuration file. if NA it creates an empty config

Value

list of configuration elements, similar generated from reading a config_file.R. The internal elements of this list are: "general", "initialization", "dispersal", "speciation", "mutation" and "ecology"

Examples

# create empty config object
config_empty <- create_input_config(config_file = NA)

# create a config object from config_file
# get path to example config
datapath <- system.file(file.path("extdata", "WorldCenter"), package = "gen3sis")
path_config <- file.path(datapath, "config/config_worldcenter.R")
config_object <- create_input_config(config_file = path_config)

# change seed of config_worldcenter config object
config_object$gen3sis$general$random_seed <- 2020

# run the model for config_object

  sim <- run_simulation(config = config_object, 
                        landscape = file.path(datapath, "landscape"), 
                        output_directory = tempdir())


gen3sis documentation built on Nov. 22, 2023, 5:07 p.m.