popsfromshape {batwing} | R Documentation |
Function takes a vector of integers between 1 and 2^npops and returns a matrix of booleans that indicate whether a population is present.
popsfromshape(shape, name = popnames)
shape |
a vector of positive integers - generally the shape output from batwing |
name |
The population names. If not given then letters used |
The populations present is based on a binary coding, 1 (...001) indicates just population 1, 2 (...010), means just population 2, 3 (...011): both 1 and 2, 4 (...100) just population 3 etc.
A matrix of logicals with either the minimum number of columns
neccessary (if name
is not provided) or with
length(name)
ccolumns.
The code works with a maximum of 32 populations
Ian Wilson I.J.Wilson@ncl.ac.uk
BATWING website http://www.mas.ncl.ac.uk/~nijw
popsfromshape(1:31) popsfromshape(5,name=c("YRI","CEU","HCB"))