Learn R Programming

kindisperse (version 0.10.2)

KinPairSimulation-class: KinPairSimulation Class

Description

The class KinPairSimulation is a formal (S4) class for storing kinship and dispersal distribution information derived from simulations in the kindisperse package. It is derived from the KinPairData class. The KinPairSimulation class is used to store information about the spatial distribution of kin dyads for use in calculating axial sigmas of intergenerational dispersal as initially implemented in Jasper et al. 2019 (https://doi.org/10.1111/1755-0998.13043).

Usage

# S4 method for KinPairSimulation
show(object)

# S4 method for KinPairSimulation initialize( .Object, data = NULL, kinship = NULL, lifestage = NULL, simtype = NULL, kerneltype = NULL, kernelshape = NULL, posigma = NULL, initsigma = NULL, breedsigma = NULL, gravsigma = NULL, ovisigma = NULL, customsigma = NULL, cycle = NULL, simdims = NULL, call = NULL, filtertype = NULL, upper = NULL, lower = NULL, spacing = NULL, samplenum = NULL, sampledims = NULL, model = NULL )

Arguments

object

object of class KinPairSimulation

.Object

object to be constructed into KinPairSimulation class

data

tbl_df. tibble of simulation values

kinship

character - one of PO, FS, HS, AV, HAV, GG, 1C, H1C, GAV, HGAV, 1C1, H1C1, GGG, 2C, and H2C.

lifestage

character - one of 'unknown', 'immature' or 'ovipositional'

simtype

character - simulation type

kerneltype

character. - 'Gaussian', 'Laplace' or 'vgamma' (variance-gamma)

kernelshape

numeric. - value of kernel shape of simulation (if using kernel with shape parameter e.g. vgamma)

posigma

numeric - overall value of dispersal sigma (for simple kernel)

initsigma

numeric. - value of pre-breeding dispersal sigma (for composite kernel)

breedsigma

numeric. - value of breeding dispersal sigma (for composite kernel)

gravsigma

numeric. - value of post-breeding dispersal sigma (for composite kernel)

ovisigma

numeric. - value of oviposition dispersal sigma (for composite kernel)

customsigma

numeric. - vector of named custom dispersal sigmas (for custom kernel)

cycle

integer - number of breeding cycles sampled individual has survived (for custom kernel)

simdims

numeric. - dimensions of sampling area (assumes one side of square)

call

call. Call to create object

filtertype

character. whether the initial sim has been further filtered

upper

numeric. - FILTER: upper threshold used

lower

numeric. - FILTER: lower threshold used

spacing

numeric. - FILTER: spacing used

samplenum

numeric. - FILTER: sample number used

sampledims

numeric. - FILTER: sample dimensions used

model

list - model information if custom simulation used to generate object

KinPairSimulation

an object of class KinPairSimulation

Value

returns object of class KinPairSimulation

No return value, called for side effects

Returns an object of class KinPairSimulation

Methods (by generic)

  • show: print method

  • initialize: initialisation method

Slots

kinship

character - one of PO, FS, HS, AV, HAV, GG, 1C, H1C, GAV, HGAV, 1C1, H1C1, GGG, 2C, and H2C.

simtype

character. - one of 'simple', 'composite' or 'custom'

kerneltype

character. - 'Gaussian', 'Laplace' or 'vgamma' (variance-gamma)

posigma

numeric. - overall value of dispersal sigma (for simple kernel)

initsigma

numeric. - value of pre-breeding dispersal sigma (for composite kernel)

breedsigma

numeric. - value of breeding dispersal sigma (for composite kernel)

gravsigma

numeric. - value of post-breeding dispersal sigma (for composite kernel)

ovisigma

numeric. - value of oviposition dispersal sigma (for composite kernel)

customsigma

numeric - vector of named custom dispersal sigmas (for custom kernel)

simdims

numeric. - dimensions of sampling area (assumes 1 side of square)

lifestage

character. - lifestage at sampling - either 'immature' or 'ovipositional'

cycle

integer - number of breeding cycles sampled individuals have survived (for custom kernel)

kernelshape

numeric. - shape parameter if vgamma kerneltype

call

call. - call to create initial simulation

tab

tbl_df. - tibble of simulation values

filtertype

character. - whether the initial sim has been further filtered

upper

numeric. - FILTER: upper threshold used

lower

numeric. - FILTER: lower threshold used

spacing

numeric. - FILTER: spacing used

samplenum

numeric. - FILTER: sample number used

sampledims

numeric. - FILTER: dimensions used

model

DispersalModel - model of dispersal used to create object (with custom type)

Details

This class is essentially wrapped around the tbl_df class but with (a) expectations around certain columns that must be present (id1, id2, kinship, & distance - three 'character' & one 'numeric' column), as well as (b) additional attributes (kinship, lifestage, & cycle) characterizing the close-kin dyads being stored.These attributes, as well as the embedded vector of distances, can be accessed with the methods kinship, lifestage, breeding_cycle and distances. In addition to the above attributes (derived from the KinPairData class), this class contains attributes capturing the simulation type & parameters used to generate the final distribution of kin dyads.

Objects from this class are returned from the simulate_kindist_composite, simulate_kindist_simple and simulate_kindist_custom functions (& related), and are directly constructed with the namesake KinPairSimulation() function. They can be passed to the sample_kindist function for filtering and subsampling, and to axial functions (including axials_standard and axpermute_standard) for estimation of axial dispersal.

See Also

Other kdclasses: DispersalModel-class, KinPairData-class