This function provides an interface for calling scrm from R.
The command line options are passed via the
The vignette 'scrm-Arguments' contains details about the available options.
Summary statistics are converted into an R format. Additionally, there
is an option to write the original command line output into a file.
A string containing the command line arguments for scrm. Look at scrms vignette for a description of available arguments.
If provided, scrm will additionally write it is output into a file with the given file, using an ms-like text output.
A named list of summary statistics. Most summary statistics are again a list, where each entry contains the value for one locus. For the site frequency spectrum, the summary statistic is a matrix, where each row contains the spectrum for one locus.
The R version of scrm uses random number from R's random generator.
Therefore, the '-seed' argument of the command line version will be ignored,
and no seed is given in the output.
Use the R function
set.seed prior to calling this
function to ensure reproduciblity of results.
vignette('scrm-Arguments') for an overview of commandline arguments and
vignette('scrm-TreesForApe') for an example on using
genealogies simulated with scrm with package 'ape'.
1 2 3 4 5 6 7 8 9
set.seed(789) # 5 Chromosomes with 100 bases each with recombination and mutation sum_stats <- scrm('5 1 -r 3.1 100 -t 1.5 -T -L') str(sum_stats) # Simulate the site frequency spectrum at 3 loci. For each locus # 10 Chromosomes of 1Mb length are sampled from two populations with # migration inbetween. scrm('10 3 -r 400 1000000 -l 100000 -I 2 4 6 0.5 -t 300 -oSFS')$sfs