Description Usage Arguments Details Value Copyright Author(s)
Documentation for SLiM function distance
, which is a method of the SLiM
class InteractionType
.
Note that the R function is a stub, it does not do anything in R (except bring
up this documentation). It will only do
anything useful when used inside a slim_block
function further
nested in a slim_script
function call, where it will be translated into valid SLiM code as part of a
full SLiM script.
1 | distance(individuals1, individuals2)
|
individuals1 |
An object of type Individual object. See details for description. |
individuals2 |
An object of type null or Individual object. The default
value is |
Returns a vector containing distances between individuals in individuals1 and individuals2. At least one of individuals1 or individuals2 must be singleton, so that the distances evaluated are either from one individual to many, or from many to one (which are equivalent, in fact); evaluating distances for many to many individuals cannot be done in a single call. (There is one exception: if both individuals1 and individuals2 are zero- length or NULL, a zero-length float vector will be returned.) If individuals2 is NULL (the default), then individuals1 must be singleton, and a vector of the distances from that individual to all individuals in its subpopulation (including itself) is returned; this case may be handled differently internally, for greater speed, so supplying NULL is preferable to supplying the vector of all individuals in the subpopulation explicitly even though that should produce identical results. If the InteractionType is non-spatial, this method may not be called. Importantly, distances are calculated according to the spatiality of the InteractionType (as declared in initializeInteractionType()), not the dimensionality of the model as a whole (as declared in initializeSLiMOptions()). The distances returned are therefore the distances that would be used to calculate interaction strengths. However, distance() will return finite distances for all pairs of individuals, even if the individuals are non- interacting; the distance() between an individual and itself will thus be 0. See interactionDistance() for an alternative distance definition.
An object of type float.
This is documentation for a function in the SLiM software, and has been reproduced from the official manual, which can be found here: http://benhaller.com/slim/SLiM_Manual.pdf. This documentation is Copyright © 2016–2020 Philipp Messer. All rights reserved. More information about SLiM can be found on the official website: https://messerlab.org/slim/
Benjamin C Haller (bhaller@benhaller.com) and Philipp W Messer (messer@cornell.edu)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.