# load hydrogen isotope data for human hair in North America
d = subOrigData(group = "Modern human", mask = naMap, genplot = FALSE)
# rescale from environmental isoscape to tissue isoscape
r = calRaster(d, d2h_lrNA, naMap, genplot = FALSE)
# four unknown-origin examples
id = c("A", "B", "C", "D")
d2H = c(-110, -90, -105, -102)
un = data.frame(id, d2H)
# posterior probabilities
pp = pdRaster(r, un, mask = naMap, genplot = FALSE)
# random collection locations
sites = d$data[sample(seq(length(d$data)), 4),]
# generate a wDist object
wd = wDist(pp, sites)
# structure of the wDist object
str(wd, 2)
Run the code above in your browser using DataLab