categoricalxy: A function to plot 2 dimensional categorical data as...

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
categoricalxy(my.data, freqlabs = FALSE, colscheme = "heat", poly.border = FALSE, axes.cex = 1)

Arguments

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 polygon for further details

axes.cex

Controls the size of the axis labels.

Value

A categorical x-y plot.

Author(s)

Owen R. Jones

See Also

get.colony.data,get.parentage

Examples

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)

rcolony documentation built on May 2, 2019, 6:42 p.m.