Learn R Programming

rNeighborQTL (version 1.1.1)

min_dist: Calculating the minimum distance

Description

A function to calculate a Euclidian distance including at least one neighbor for all individuals.

Usage

min_dist(smap, grouping = rep(1, nrow(smap)))

Arguments

smap

A matrix showing a spatial map. The first and second column include spatial points along a x-axis and y-axis, respectively.

grouping

A 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.

Value

Return a scalar of the minimum Euclidian distance that allows all individuals to have at least one neighbor.