Last chance! 50% off unlimited learning
Sale ends in
Displays box-and-whisker plots of the given (grouped) values.
# S4 method for LogRatio
boxplot(
x,
...,
range = 1.5,
width = NULL,
varwidth = FALSE,
notch = FALSE,
outline = TRUE,
plot = TRUE,
horizontal = FALSE,
xlab = NULL,
ylab = NULL,
main = NULL,
sub = NULL,
ann = graphics::par("ann")
)# S4 method for GroupedLogRatio
boxplot(
x,
...,
range = 1.5,
width = NULL,
varwidth = FALSE,
notch = FALSE,
outline = TRUE,
plot = TRUE,
horizontal = FALSE,
color = NULL,
xlab = NULL,
ylab = NULL,
main = NULL,
sub = NULL,
ann = graphics::par("ann"),
legend = list(x = "topright")
)
boxplot()
is called for its side-effects: is results in a graphic being
displayed (invisibly return x
).
A LogRatio
object.
Further graphical parameters.
A length-one numeric
vector specifying how far the plot
whiskers extend out from the box (see graphics::boxplot()
).
A numeric
vector giving the relative widths of the boxes
making up the plot.
A logical
scalar: should the boxes be drawn with widths
proportional to the square-roots of the number of observations in the
groups?
A logical
scalar: should a notch be drawn in each side of
the boxes?
A logical
scalar: should the outliers be drawn?
A logical
scalar: should a boxplot be produced? If FALSE
,
the summaries which the boxplots are based on are invisibly returned.
A logical
scalar: should the boxplots be horizontal?
A character
vector giving the x and y axis labels.
A character
string giving a main title for the plot.
A character
string giving a subtitle for the plot.
A logical
scalar: should the default annotation (title and x
and y axis labels) appear on the plot?
A (named) vector of colors (will be mapped to the group names
of object
) or a function
that when called with a single argument (an
integer specifying the number of colors) returns a vector of colors.
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.
N. Frerebeau
## Data from Day et al. 2011
data("kommos", package = "folio")
kommos <- remove_NA(kommos, margin = 1) # Remove cases with missing values
coda <- as_composition(kommos, parts = 3:22) # Coerce to compositional data
## Log ratio
clr <- transform_clr(coda)
## Boxplot
boxplot(clr)
## Use ceramic types for grouping
grp <- group(coda, by = kommos$type)
clr <- transform_clr(grp)
boxplot(clr)
Run the code above in your browser using DataLab