Description Usage Arguments Examples

Infer the radius of Wright's genetic neighborhood from codominant marker genotypes. The correct radius is equal to 2 sigma, where sigma is the mean parent-offspring dispersal distance.

1 | ```
infer2sigma(genind_obj, xy, dist.mat, radii, min_N, max_N = NULL)
``` |

`genind_obj` |
A genind object (created by the adegenet package function import2genind or related methods) containing individual genotypes. The order of the individuals must be the same as the order in the xy and dist.mat inputs below. |

`xy` |
A dataframe containing 3 columns in the following order: individual IDs, X coordinates, and Y coordinates. The order of the rows must match the order in the genind_obj and dist.mat inputs. |

`dist.mat` |
An NxN (N= sample size) matrix of pairwise landscape distances (Euclidean or effective). The |

`radii` |
A vector of neighborhood radii at which to evaluate the evidence for the correct neighborhood radius. |

`min_N` |
The minimum sample size per neighborhood for indices to be calculated. NA is returned for neighborhoods < |

`max_N` |
Optional. The maximum sample size per neighborhood for indices to be calculated. If the number of individuals in the neighborhood exceeds |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
library(sGD)
library(adegenet)
# read in genotypes, locations, and distance matrix
genepop.file <- system.file("extdata","sGD_demo_IBR.gen",package="sGD")
xy = read.csv(system.file("extdata","sGD_demo_xy.csv",package="sGD"))
dist.mat <- as.matrix(read.csv(system.file("extdata","sGD_demo_cdmat.csv",package="sGD"),
header=FALSE))
# convert genepop to genind (make sure you specify the correct allele code digits - ncode)
genind_obj <- read.genepop(genepop.file,ncode=3L,quiet=TRUE)
# specify radii to evaluate
radii = c(8000,12000,16000,20000,24000)
# run infer2sigma
est2sigma <- infer2sigma(genind_obj,xy,dist.mat,radii,min_N=20)
radii_summary = aggregate(FIS~radius,est2sigma,median)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.