Plots a spot matrix.
plot_spot(object, ...)# S4 method for matrix
plot_spot(
object,
type = c("ring", "plain"),
color = NULL,
diag = TRUE,
upper = TRUE,
lower = TRUE,
freq = FALSE,
margin = 1,
axes = TRUE,
legend = TRUE,
...
)
# S4 method for data.frame
plot_spot(
object,
type = c("ring", "plain"),
color = NULL,
diag = TRUE,
upper = TRUE,
lower = TRUE,
freq = FALSE,
margin = 1,
axes = TRUE,
legend = TRUE,
...
)
# S4 method for dist
plot_spot(
object,
type = c("ring", "plain"),
color = NULL,
diag = FALSE,
upper = FALSE,
lower = !upper,
axes = TRUE,
legend = TRUE,
...
)
plot_spot()
is called for its side-effects: it results in a graphic
being displayed (invisibly returns object
).
A numeric
matrix
or
data.frame
of count data (absolute frequencies giving the number of
individuals for each category, i.e. a contingency table).
Currently not used.
A character
string specifying the graph to be plotted.
It must be one of "ring
" (the default) or "plain
". Any unambiguous
substring can be given.
A vector of colors or a function
that when called with a
single argument (an integer specifying the number of colors) returns a
vector of colors.
A logical
scalar indicating whether the diagonal of the
matrix should be plotted. Only used if object
is a symmetric matrix.
A logical
scalar indicating whether the upper triangle of
the matrix should be plotted. Only used if object
is a symmetric matrix.
A logical
scalar indicating whether the lower triangle of
the matrix should be plotted. Only used if object
is a symmetric matrix.
A logical
scalar indicating whether conditional proportions
given margins
should be used (i.e. entries of object
, divided by the
appropriate marginal sums).
An integer
vector giving the margins to split by:
1
indicates individuals/rows (the default), 2
indicates
variables/columns. Only used if freq
is TRUE
.
A logical
scalar: should axes be drawn on the plot? It will
omit labels where they would abut or overlap previously drawn labels.
A logical
scalar: should a legend be displayed?
N. Frerebeau
The spot matrix can be considered as a variant of the Bertin diagram where the data are first transformed to relative frequencies.
Other plot methods:
matrigraph()
,
plot_bertin()
,
plot_diceleraas()
,
plot_ford()
,
plot_heatmap()
,
plot_rank()
,
seriograph()
## Data from Huntley 2004, 2008
data("pueblo")
## Plot spot diagram of count data
plot_spot(pueblo, type = "ring")
plot_spot(pueblo, type = "plain")
## Plot conditional proportions
plot_spot(pueblo, freq = TRUE, margin = 1)
plot_spot(pueblo, freq = TRUE, margin = 2)
Run the code above in your browser using DataLab