Generates a SLiM script from a built-in slendr template, substituting all required parameters by values specified by the user. The user has an option to either run the script in batch mode, open it in SLiMgui, or simply save the generated SLiM script to a given location for later use.

slim(
model,
seq_length,
recomb_rate,
output_dir = model\$path,
output_prefix = "output",
save_locations = FALSE,
track_ancestry = FALSE,
ts_recording = FALSE,
sampling = NULL,
method,
verbose = TRUE,
include = NULL,
burnin = 0,
seed = NULL,
slim_path = NULL,
overwrite = FALSE
)

## Arguments

model Model object created by the compile function Total length of the simulated sequence (in base-pairs) Recombination rate of the simulated sequence (in recombinations per basepair per generation) A directory where to put simulation outputs (by default, all output files are placed in a model directory) A common prefix of output files (by default, all files will share a prefix "output") Save location of each individual throughout the simulation? Track ancestry proportion dynamics in all populations throughout the simulations (default FALSE)? If a non-zero integer is provided, ancestry will be tracked using the number number of neutral ancestry markers equal to this number. Turn on tree sequence recording during SLiM initialization? How to run the script? ("gui" - open in SLiMgui, "batch" - run on the command-line, "script" - simply return the script) Write the SLiM output log to the console (default FALSE)? Vector of paths to custom SLiM scripts which should be combined with the backend SLiM code Length of the burnin (in model's time units, i.e. years) Random seed (if missing, SLiM's own seed will be used) Optional way to specify path to an appropriate SLiM binary Overwrite the contents of the output directory (default FALSE)? A data frame of times at which a given number of individuals should be remembered in the tree-sequence (see sampling for a function that can generate the sampling schedule in the correct format). If missing, only individuals present at the end of the simulation will be recorded in the tree-sequence output file.