Learn R Programming

tabula (version 1.6.1)

plot_spot: Spot Plot

Description

Plots a spot matrix.

Usage

plot_spot(object, ...)

# S4 method for matrix plot_spot(object, threshold = NULL, diag = TRUE, upper = TRUE, ...)

# S4 method for dist plot_spot(object, diag = FALSE, upper = FALSE, ...)

# S4 method for OccurrenceMatrix plot_spot(object, diag = FALSE, upper = FALSE, ...)

Arguments

object

An abundance matrix to be plotted.

...

Extra parameters to be passed to threshold.

threshold

A function that takes a numeric vector as argument and returns a numeric threshold value. If NULL (the default), no threshold is computed.

diag

A logical scalar indicating whether the diagonal of the matrix should be plotted.

upper

A logical scalar indicating whether the upper triangle of the matrix should be plotted.

Value

A ggplot2::ggplot object.

Details

The spot matrix can be considered as a variant of the Bertin diagram where the data are first transformed to relative frequencies.

See Also

Other plot: plot_bar, plot_diversity, plot_line, plot_matrix

Examples

Run this code
# NOT RUN {
## Plot spot diagram of count data...
data("mississippi", package = "folio")
counts <- as_count(mississippi)

### ...without threshod
plot_spot(counts)
### ...with the  column means as threshold
plot_spot(counts, threshold = mean)
### ...with the column medians as threshold
plot_spot(counts, threshold = median)
# }

Run the code above in your browser using DataLab