substitute_values: Substitute values of parameters in a SLiM extension template

View source: R/extensions.R

substitute_valuesR Documentation

Substitute values of parameters in a SLiM extension template

Description

Substitute values of templated {{parameters}} in a given SLiM extension template

Usage

substitute_values(template, ...)

Arguments

template

Either a path to an extension script file, or a string containing the entire SLiM extension code

...

Named function arguments interpreted as key=value pairs to be used in argument substitution

Details

If a file or a multi-line string given as template contains parameters specified as {{param}} where "param" can be arbitrary variable name, this function substitutes each templated {{parameter}} for a given values. Such modified template is then used to extend a built-in slendr SLiM script, allowing for a customization of its default behavior (most commonly replacing its assumption of neutrality for non-neutral scenarios, such as simulations of natural selection).

Value

Path to a file with a saved extension script containing all substituted values


bodkan/slendr documentation built on Dec. 19, 2024, 11:41 p.m.