popsfromshape {batwing}R Documentation

Get a shape from a vector of population labels

Description

Function takes a vector of integers between 1 and 2^npops and returns a matrix of booleans that indicate whether a population is present.

Usage

popsfromshape(shape, name = popnames)

Arguments

shape a vector of positive integers - generally the shape output from batwing
name The population names. If not given then letters used

Details

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.

Value

A matrix of logicals with either the minimum number of columns neccessary (if name is not provided) or with length(name) ccolumns.

Warning

The code works with a maximum of 32 populations

Author(s)

Ian Wilson I.J.Wilson@ncl.ac.uk

References

BATWING website http://www.mas.ncl.ac.uk/~nijw

See Also

supported

Examples

popsfromshape(1:31)
popsfromshape(5,name=c("YRI","CEU","HCB"))

[Package batwing version 0.1 Index]