Description Usage Arguments Value Author(s) See Also Examples
This function produces a plot for two-dimensional categorical data (e.g. individual's ID) to show presence/absence or frequency for each category. The resulting plot is a chequer-board with each square representing a pairwise observation. The square can provide further information on (for example) frequency by colouring and/or by the inclusion of text.
1 2 | categoricalxy(my.data, freqlabs = FALSE, colscheme = "heat",
poly.border = FALSE, axes.cex = 1)
|
my.data |
A dataframe with 3 columns. The first two columns should be categorical variables (coded as factors), while the third should indicate another dimension such as frequency. |
freqlabs |
Should the values of the z dimension (the 3rd column in my.data) be included as text: TRUE/FALSE |
colscheme |
Colour scheme: options are "heat" (heatmap colours) or "greyscale" (greyscale colours. Any other input will result in black squares with a grey background. |
poly.border |
Defines the borders around the individual squares in the
plot. See |
axes.cex |
Controls the size of the axis labels. |
A categorical x-y plot.
Owen R. Jones
1 2 3 4 5 6 7 8 | foo<-expand.grid(ID1=c("A","B","C","D"),ID2=c("W","X","Y","Z"))
foo$freq<-ceiling(runif(dim(foo)[1],0,10))
categoricalxy(foo,freqlabs=TRUE)
data(testdata)
x<-get.parentage(testdata)
categoricalxy(x,colscheme="heat",axes.cex=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.