memberPlot: Membership Plots

View source: R/07-memberPlot.R

memberPlotR Documentation

Membership Plots

Description

Membership plots are a graphical visualization of cross-membership of many individuals in many categories. Although Venn diagrams work well for this purpose when there are three or four categories, they can be difficiult to interpet, or even impossible to draw, with more categories. In this case, membership plots are more useful.

Usage

memberPlot(bindat, features = NULL, pal = NULL, xlab = "Members",
           ylab = "Categories", ...)

Arguments

bindat

A binary matrix where rows are categories, columns are members, 1 debnotes membership and 0 denotes nonmembership. Muissing data is not permitted.

pal

A character vector of colors. The first color is used for non-members; all other colors are used to denote different categories.

features

A numeric vector listing the number of features measured in each membership data set.

xlab

The usual graphical parameter.

ylab

The usual graphical parameter.

...

Additional plot parameters, especially "main" or "sub".

Details

Membership plots are implemented as an image, where each row represents a different category and is shown in a different color. Non-membership is indicated by the same color regardless fo category; by dafault, we use "gray" for non-members. The data are sorted so that the number of members per category decreases from the bottom tot he top of the plot. They are also sorted so that membership in larger categories is prioritized from left to right.

Value

The transformed input matrix is returned invisibly. The main purpose of the function is teh "side-effect" or producing a plot.

Author(s)

Kevin R. Coombes <krc@silicovore.com>

Examples

set.seed(98765)
categ <- 6
member <- 500
M <- matrix(rbinom(categ*member, 1, 0.5), nrow = categ)
rownames(M) <- LETTERS[1:categ]
memberPlot(M)

Polychrome documentation built on May 3, 2022, 9:07 a.m.