Description Usage Arguments Details Value Author(s) References Examples
A function to calculate neighbor genotypic identity, with a given reference scale and a degree of distance decay.
1 2 3 4 5 6 7 8 9 |
geno |
An individual x marker matrix. Bialleles (i.e., A or a) must be converted into -1 or 1 digit. |
smap |
A matrix showing a spatial map for individuals. The first and second column include spatial points along an x-axis and y-axis, respectively. |
scale |
A numeric scalar indicating the maximum spatial distance between a focal individual and neighbors to define neighbor effects. |
alpha |
An option to set a distance decay coefficient α in a dispersal kernel. Default is set at Inf, meaning no distance decay. |
kernel |
An option to select either |
grouping |
A positive integer vector assigning each individual to a group. This argument can be useful when a "smap" contains different experimental replicates. Default setting means that all individuals are belong to a single group. |
n_core |
No. of cores for a multi-core computation. This does not work for Windows OS. Default is a single-core computation. |
Default setting is recommended for alpha
and kernel
arguments unless spatial distance decay of neighbor effects needs to be modeled.
If alpha
is not Inf
, output variables are weighted by a distance decay from a focal individual to scale
.
For the type of dispersal kernel in the distance decay, we can choose a negative exponential or Gaussian kernel as a fat-tailed or thin-tailed distribution, respectively.
See Nathan et al. (2012) for detailed characteristics of the two dispersal kernels.
A numeric matrix for neighbor covariates, with no. of individuals x markers.
Yasuhiro Sato (sato.yasuhiro.36c@kyoto-u.jp)
Nathan R, Klein E, Robledo-Arnuncio JJ, Revilla E. (2012) Dispersal kernels: review. In: Clobert J, Baguette M, Benton TG, Bullock JM (Eds.), Dispersal Ecology and Evolution. Oxford University Press, pp.186-210.
1 2 3 4 5 6 7 8 9 | set.seed(1)
g <- matrix(sample(c(-1,1),100*1000,replace = TRUE),100,1000)
gmap <- cbind(c(rep(1,nrow(g)/2),rep(2,nrow(g)/2)),c(1:ncol(g)))
x <- runif(nrow(g),1,100)
y <- runif(nrow(g),1,100)
smap <- cbind(x,y)
grouping <- c(rep(1,nrow(g)/2), rep(2,nrow(g)/2))
g_nei <- nei_coval(g,smap,44,grouping = grouping)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.