Schedule sampling events at specified times and, optionally, a given set of locations on a landscape

schedule_sampling(model, times, ..., locations = NULL, strict = FALSE)

Arguments

model

Object of the class slendr_model

times

Integer vector of times (in model time units) at which to schedule remembering of individuals in the tree-sequence

...

Lists of two elements (slendr_pop population object-<number of individuals to sample), representing from which populations should how many individuals be remembered at times given by times

locations

List of vector pairs, defining two-dimensional coordinates of locations at which the closest number of individuals from given populations should be sampled. If NULL (the default), individuals will be sampled randomly throughout their spatial boundary.

strict

Should any occurence of a population not being present at a given time result in an error? Default is FALSE, meaning that invalid sampling times for any populations will be quietly ignored.

Value

Data frame with three columns: time of sampling, population to sample from, how many individuals to sample

Details

If both times and locations are given, the the sampling will be scheduled on each specified location in each given time-point. Note that for the time-being, in the interest of simplicity, no sanity checks are performed on the locations given except the restriction that the sampling points must fall within the bounding box around the simulated world map. Other than that, slendr will simply instruct its SLiM backend script to sample individuals as close to the sampling points given as possible, regardless of whethere those points lie within a population spatial boundary at that particular moment of time.