hgdp | R Documentation |
The datasets hgdp
and hgdpPlus
provides genetic diversity
several human populations worldwide. Both datasets are gData
objects, interfaced with the gGraph object
worldgraph.40k
.
hgdp
is a gGraph object with the following
data: %
%
habitat corresponding to each % vertice; currently 'land' or 'sea'.
%
a matrix assigning a color for plotting % vertices (second column) to different values of habitat (first % column).
%
hgdp
describes 52 populations from the original Human Genome
Diversity Panel.
hgdpPlus
describes hgdp
populations plus 24 native American
populations.
Authors Journal, YEAR, nb: pp-pp.
## check object
hgdp
## plotting the object
plot(hgdp)
## results from Handley et al.
## Not run:
## Addis Ababa
addis <- list(lon = 38.74, lat = 9.03)
addis <- closestNode(worldgraph.40k, addis) # this takes a while
## shortest path from Addis Ababa
myPath <- dijkstraFrom(hgdp, addis)
## plot results
plot(worldgraph.40k, col = 0)
points(hgdp)
points(worldgraph.40k[addis], psize = 3, pch = "x", col = "black")
plot(myPath)
## correlations distance/genetic div.
geo.dist <- sapply(myPath[-length(myPath)], function(e) e$length)
gen.div <- getData(hgdp)[, "Genetic.Div"]
plot(gen.div ~ geo.dist)
lm1 <- lm(gen.div ~ geo.dist)
abline(lm1, col = "blue") # this regression is wrong
summary(lm1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.