pair.plot: Plots pairwise comparisons

View source: R/pair.plot.R

pair.plotR Documentation

Plots pairwise comparisons

Description

Plots pairwise comparisons from a data frame (typically output from test.dispRity).

Usage

pair.plot(
  data,
  what,
  col = c("black", "white"),
  legend = FALSE,
  binary,
  diag,
  add,
  lower = TRUE,
  ...
)

Arguments

data

A matrix or a data.frame object with comparisons' pair names as row names. The number of rows must be equal to a pairwise combination of n elements (see details).

what

A numeric or character value designating which column to plot.

col

The two extremes of a color gradient (default = c("black", "white")).

legend

Logical, whether to plot the legend or not.

binary

Optional, if the results must be binary, a numeric value for the threshold of acceptance (values greater will be 1, lower will be 0).

diag

Optional, can be "max" or "min" or a single numeric value.

add

Optional, whether to add significance tokens can be numeric for a point type to print (pch) or "character" to print (e.g. "*").

lower

Optional, logical, whether to add tokens for values lower than binary (default is TRUE; FALSE will add tokens for values bigger than binary).

...

Any other options to be passed to plot.

Details

The number of rows (i.e. comparisons) in matrix must be equal to the results of a pairwise combination. In general, the number of rows x must satisfy the equation: x = n^2 / 2 - n / 2 where n must be an integer greater or equal than 2.

Author(s)

Thomas Guillerme

See Also

test.dispRity.

Examples

## A small matrix of two pairwise comparisons of seven elements (2*21 comparisons)
data <- matrix(data = runif(42), ncol = 2)

## Plotting the first column as a pairwise comparisons
pair.plot(data, what = 1, col = c("orange", "blue"), legend = TRUE, diag = 1)

## Adding some tokens for each value below 0.2 in the second column
pair.plot(data, what = 2, binary = 0.2, add = "*", cex = 2)

## Loading disparity data
data(disparity)

## Testing the pairwise difference between slices
tests <- test.dispRity(disparity, test = wilcox.test, correction = "bonferroni")

## Plotting the significance
pair.plot(as.data.frame(tests), what = "p.value", binary = 0.05)


TGuillerme/dispRity documentation built on Dec. 21, 2024, 4:05 a.m.