R/slimr_script.R
as_slim_text.slimr_script.Rd
Convert a slimr_script to a length 1 character vector
# S3 method for slimr_script
as_slim_text(x, ...)
slimr_script
object to convert
Further arguments, passed to or from other methods.
A length 1 character vector
slim_script(
slim_block(initialize(),
{
initializeMutationRate(1e-7);
initializeMutationType("m1", 0.5, "f", 0.0);
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 99999);
initializeRecombinationRate(1e-8);
}),
slim_block(1,
{
sim.addSubpop("p1", 500);
}),
slim_block(10000,
{
sim.simulationFinished();
})
) -> script
as_slim_text(script)
#> [1] "initialize() {\n initializeMutationRate(1e-07);\n initializeMutationType(\"m1\", 0.5, \"f\", 0);\n initializeGenomicElementType(\"g1\", m1, 1);\n initializeGenomicElement(g1, 0, 99999);\n initializeRecombinationRate(1e-08);\n}\n\n1 early() {\n sim.addSubpop(\"p1\", 500);\n}\n\n10000 early() {\n sim.simulationFinished();\n}\n"