View source: R/07-memberPlot.R
memberPlot | R Documentation |
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.
memberPlot(bindat, features = NULL, pal = NULL, xlab = "Members", ylab = "Categories", ...)
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". |
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.
The transformed input matrix is returned invisibly. The main purpose of the function is teh "side-effect" or producing a plot.
Kevin R. Coombes <krc@silicovore.com>
set.seed(98765) categ <- 6 member <- 500 M <- matrix(rbinom(categ*member, 1, 0.5), nrow = categ) rownames(M) <- LETTERS[1:categ] memberPlot(M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.