Description Usage Arguments Value Author(s) Examples
A function to calculate a Euclidian distance including at least one neighbor for all individuals.
1 |
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. |
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. |
Return a scalar of the minimum Euclidian distance that allows all individuals to have at least one neighbor.
Yasuhiro Sato (sato.yasuhiro.36c@kyoto-u.jp)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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))
pheno <- nei_simu(geno=g,smap=smap,scale=44,grouping=grouping,n_causal=50,pveB=0.4,pve=0.8)
fake_nei <- list()
fake_nei[[1]] <- g
fake_nei[[2]] <- gmap
fake_nei[[3]] <- smap
fake_nei[[4]] <- data.frame(pheno,grouping)
names(fake_nei) <- c("geno","gmap","smap","pheno")
min_s <- min_dist(fake_nei$smap, fake_nei$pheno$grouping)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.