If two samples share no loci typed in common, they are incomparable and will produce missing data in a distance matrix, which could lead to problems with further analyses. This function finds these samples and returns a matrix of how many other samples these are incomparable with.

incomp(gid)

Arguments

gid

a genind or genclone object

Value

a square matrix with samples that are incomparable

Examples

data(nancycats) # These two populations have no samples that are incomparable incomp(nancycats[pop = c(1, 17)])
#> <0 x 0 matrix>
# If you reduce the number of loci, we find that there are # incomparable samples. incomp(nancycats[pop = c(1, 17), loc = c(1, 4)])
#> N215 N216 N282 N283 N288 N291 N292 N293 N294 N295 N296 N297 N281 N289 N290 #> N215 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 #> N216 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 #> N282 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N283 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N288 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N291 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N292 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N293 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N294 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N295 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N296 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N297 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N281 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N289 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 #> N290 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1