- Updated
slimr
to be fully compatible with SLiM v4.1 updates - Changed
SLIM_HOME
environmental variable toSLIMR_PATH
, which now should be set with the full path to the SLiM executable, not just the directory containing it - Updated
slim_setup()
function which now provides cross-platform automatic installation using conda via thereticulate
package. Now it should not be necessary for users to manually install SLiM any more - Simplified
slim_run()
API and temporarily removed ability to use R callbacks (the plan is to eventually replace this functionality with a new 'slimr
verb' function) - Added new '
slimr
verb'r_message()
.r_message()
can be called in aslim_block()
to print a message to the R console while the SLiM simulation is running. This is useful for debugging and monitoring progress of a simulation. slim_run()
withprogress = TRUE
now produces a progress bar for any simulation (previously it only worked if you created output withr_output()
) and is much more efficient (produces less overhead)slim_script_render_dots()
function added. It works just likeslim_script_render()
, but accepts values to be filled in a templatedslimr_script
as named arguments. For exampleslim_script_render_dots(x, mut_rate = c(1e-6, 1e-7))
will render theslimr_script
calledx
withmut_rate
set to1e-6
and1e-7
. This can sometimes be less verbose than using a list or data frame to fill in a templatedslimr_script
, especially useful when you simply want to test different values quickly.
- Added
slim_auto()
function to automatically insertr_template()
andr_inline()
statement in useful places in aslimr_script
, based on computational graph analysis - Added
as_slimr_code()
function, which is similar toas_slimr_script()
, which converts SLiM code as a character vector into aslimr_script
object, butas_slimr_code()
returns the code necessary to create theslimr_script
instead. this allows copy and pasting the text into the R console or IDE so that it can be subsequently edited and modified. - Added vignette showing how to create a multispecies model in
slimr
, and documented the multispecies feature in the documentation forslim_block()
- allow user to manually set SLiM executable directory with
SLIM_HOME
environmental variable
- all SLiM callbacks now supported
- slimr now fully supports SLiM versions 4.0 and greater, including support for multispecies models (though these have been extensively tested yet) and are currently undocumented
- slimr verbs are now prefixed with
r_
(e.g.r_output
,r_inline
,r_template
). The old versionslimr_
prefixed version are still available for backwards compatibility, but should be considered soft-deprecated
- SLiM Classes available for help with autocomplete now have nested class objects
(e.g.
sim$subpopulations
references aSubpopulation
object, so you can then autocompletesim$subpopulations$individuals
, for example) $
accessor can now be used in place of SLiM's.
operator. (previously user's always had to use%.%
to represent.
)slimr
now replaces any<-
assignment operators in SLiM code with=
.
slim_run()
function runs aslimr_script
in SLiM and collects resultsslimr
'verbs' implemented (slimr_template()
,slimr_inline()
, andslimr_output()
). These can be used inside SLiM coding block to powerful effect!slim_block()
creates blocks of SLiM code, andslim_script()
puts them together into scripts.- Package functional
- Added a
NEWS.md
file to track changes to the package.