plot.char.diff: Plots character differences

View source: R/plot.char.diff.R

plot.char.diffR Documentation

Plots character differences

Description

Plots a character difference matrix from a discrete character matrix or its character differences density profile.

Usage

## S3 method for class 'char.diff'
plot(
  x,
  ...,
  type = "matrix",
  legend = TRUE,
  legend.title = "Difference",
  legend.pos = "topleft",
  legend.round = 0,
  axis = TRUE,
  xlim,
  ylim,
  xlab,
  ylab,
  col,
  main
)

Arguments

x

A discrete matrix or an already computed character difference matrix of class char.diff.

...

Any additional graphical arguments to be passed to image.

type

Either "matrix" (or "m") or "density" (or "d") for respectively plotting the matrix of character differences or its character differences density profile.

legend

A logical value stating whether to print the legend or not (default = TRUE).

legend.title

A character string to be displayed as the title of the legend (default = Difference).

legend.pos

The position of the legend. Can be two numeric. Default is "topleft".

legend.round

A numeric value for digits up legend values. Default is 0.

axis

A logical value stating whether to print the axis or not (default = TRUE).

xlim

Two numeric values to determine the x axis limits. If missing (default), the limits are calculated automatically to fit the plot window.

ylim

Two numeric values to determine the y axis limits. If missing (default), the limits are calculated automatically to fit the plot window.

xlab

A character string for the the x axis. Can be missing.

ylab

A character string for the the y axis. Can be missing.

col

Two colors for forming the gradient if type = "correlation" or for the density lines colors if type = "density".

main

An overall title for the plot.

Author(s)

Thomas Guillerme

See Also

char.diff

Examples

## Comparing two characters
char.diff(list(c(0, 1, 0, 1), c(0, 1, 1, 1)))

## Pairwise comparisons in a morphological matrix
morpho_matrix <- matrix(sample(c(0,1), 100, replace = TRUE), 10)

## Plotting a matrix
plot.char.diff(morpho_matrix)

## Plotting the density profile of a char.diff object
char.diff_matrix <- char.diff(morpho_matrix)
plot(char.diff_matrix, type = "density")


dispRity documentation built on May 29, 2024, 9:40 a.m.