Skip to contents

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 and col.

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 that as.factor(groups) defines the grouping. If set, a matrix of panels defined by groups 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 if rug is TRUE.

ncol

An integer specifying the number of columns to use when facet 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 to graphics::legend(); names of the list are used as argument names. If NULL, no legend is displayed.

Value

plot() is called for its side-effects: is results in a graphic being displayed (invisibly return x).

See also

Other plot methods: as_graph(), barplot(), hist(), plot()

Author

N. Frerebeau

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
#> 1 qualitative variable was removed: date.

## Log ratio
clr <- transform_clr(coda)
plot(clr, group = NULL, flip = TRUE, border = "black", col = NA)

plot(clr, flip = TRUE)