Displays a density plot.
Usage
# S4 method for LogRatio,missing
plot(
x,
...,
order = NULL,
decreasing = FALSE,
groups = get_groups(x),
rug = TRUE,
ticksize = 0.05,
ncol = NULL,
flip = FALSE,
xlab = NULL,
ylab = NULL,
main = NULL,
ann = graphics::par("ann"),
axes = TRUE,
frame.plot = axes,
legend = list(x = "topright")
)
Arguments
- x
A
LogRatio
object.- ...
Further graphical parameters, particularly,
border
andcol
.- order
A
logical
scalar: should the ratio be ordered?- decreasing
A
logical
scalar: should the sort order be increasing or decreasing?- groups
A
factor
in the sense thatas.factor(groups)
defines the grouping. If set, a matrix of panels defined bygroups
will be drawn.- rug
A
logical
scalar: should a rug representation (1-d plot) of the data be added to the plot?- ticksize
A length-one
numeric
vector giving the length of the ticks making up the rug. Positive lengths give inwards ticks. Only used ifrug
isTRUE
.- ncol
An
integer
specifying the number of columns to use whenfacet
is "multiple
". Defaults to 1 for up to 4 series, otherwise to 2.- flip
A
logical
scalar: should the y-axis (ticks and numbering) be flipped from side 2 (left) to 4 (right) from variable to variable?- xlab, ylab
A
character
vector giving the x and y axis labels.- main
A
character
string giving a main title for the plot.- ann
A
logical
scalar: should the default annotation (title and x and y axis labels) appear on the plot?- axes
A
logical
scalar: should axes be drawn on the plot?- frame.plot
A
logical
scalar: should a box be drawn around the plot?- legend
A
list
of additional arguments to be passed tographics::legend()
; names of the list are used as argument names. IfNULL
, no legend is displayed.
Value
plot()
is called for its side-effects: is results in a graphic being
displayed (invisibly return x
).
Examples
## Data from Day et al. 2011
data("kommos", package = "folio") # Coerce to compositional data
kommos <- remove_NA(kommos, margin = 1) # Remove cases with missing values
coda <- as_composition(kommos, groups = 1) # Use ceramic types for grouping
## Log ratio
clr <- transform_clr(coda)
plot(clr, group = NULL, flip = TRUE, border = "black", col = NA)
plot(clr, flip = TRUE)