Box: Box

View source: R/box.R

BoxR Documentation

Box

Description

Box plot.

Usage

Box(
  x,
  weights = NULL,
  vertical = TRUE,
  show.values = FALSE,
  density.color = "#008000",
  values.color = "#008000",
  box.points = "Suspected outliers",
  global.font.family = "Arial",
  global.font.color = rgb(44, 44, 44, maxColorValue = 255),
  title = "",
  title.font.family = global.font.family,
  title.font.color = global.font.color,
  title.font.size = 16,
  title.align = "center",
  subtitle = "",
  subtitle.font.family = global.font.family,
  subtitle.font.color = global.font.color,
  subtitle.font.size = 12,
  subtitle.align = "center",
  footer = "",
  footer.font.family = global.font.family,
  footer.font.color = global.font.color,
  footer.font.size = 8,
  footer.align = "center",
  footer.wrap = TRUE,
  footer.wrap.nchar = 100,
  background.fill.color = "transparent",
  background.fill.opacity = 1,
  charting.area.fill.color = background.fill.color,
  charting.area.fill.opacity = 0,
  margin.top = NULL,
  margin.bottom = NULL,
  margin.left = NULL,
  margin.right = NULL,
  grid.show = FALSE,
  values.title = "",
  values.title.font.color = global.font.color,
  values.title.font.family = global.font.family,
  values.title.font.size = 12,
  values.line.width = 0,
  values.line.color = rgb(0, 0, 0, maxColorValue = 255),
  values.tick.mark.length = 0,
  values.bounds.minimum = NULL,
  values.bounds.maximum = NULL,
  values.tick.distance = NULL,
  values.tick.maxnum = NULL,
  values.tick.mark.color = "transparent",
  values.zero = FALSE,
  values.zero.line.width = 0,
  values.zero.line.color = rgb(44, 44, 44, maxColorValue = 255),
  values.grid.width = 1 * grid.show,
  values.grid.color = rgb(225, 225, 225, maxColorValue = 255),
  values.tick.show = TRUE,
  values.tick.suffix = "",
  values.tick.prefix = "",
  values.tick.format = "",
  values.hovertext.format = "",
  values.tick.angle = NULL,
  values.tick.font.color = global.font.color,
  values.tick.font.family = global.font.family,
  values.tick.font.size = 10,
  categories.tick.font.color = global.font.color,
  categories.tick.font.family = global.font.family,
  categories.tick.font.size = 10,
  categories.tick.angle = NULL,
  categories.tick.label.wrap = TRUE,
  categories.tick.label.wrap.nchar = 21,
  categories.tick.mark.length = 20,
  hovertext.font.family = global.font.family,
  hovertext.font.size = 11,
  hover.on = c("all", "points")[1],
  modebar.show = FALSE
)

Arguments

x

A list, where each vector contains data to be plotted. If the data is not numeric it is coerced to be numeric. Input data may be a matrix or a vector, containing the height of the columns to be plotted, with the name/rownames used as the column names of the chart. Numeric and date labels will be parsed automatically.

weights

An optional list, where each element is a vector containing weights corresponding to the values of x, or, a vector where the weights is assumed applicable for each element in x.

vertical

Display the densities vertically.

show.values

Produces a rug plot of individual values.

density.color

Defaults to "Green". This can be a single color or a vector of colors, with the same length as the number of variables

values.color

Defaults to "Green"

box.points

How outliers are displayed boxplots. "All" plots all the points. "Suspected outliers" plots points between 1.5 and 3 IQR from the 1st and 3rd quartile with un-filled circles. "Outliers" does not plot points between 1.5 and 3 IQR from the 1st and 3rd quartiles.

global.font.family

Character; font family for all occurrences of any font attribute for the chart unless specified individually.

global.font.color

Global font color as a named color in character format (e.g. "black") or an rgb value (e.g. #' rgb(0, 0, 0, maxColorValue = 255)).

title

Character; chart title.

title.font.family

Character; title font family. Can be "Arial Black", "Arial", "Comic Sans MS", "Courier New", "Georgia", "Impact", "Lucida Console", "Lucida Sans Unicode", "Marlett", "Symbol", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana", "Webdings"

title.font.color

Title font color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

title.font.size

Title font size; default = 10.

title.align

Horizontal alignment of title

subtitle

Character

subtitle.font.family

Character; subtitle font family

subtitle.font.color

subtitle font color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

subtitle.font.size

Integer; subtitle font size

subtitle.align

Horizontal alignment of subtitle

footer

Character

footer.font.family

Character; footer font family

footer.font.color

footer font color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

footer.font.size

Integer; footer font size

footer.align

Horizontal alignment of footer

footer.wrap

Logical; whether the footer text should be wrapped.

footer.wrap.nchar

Number of characters (approximately) in each line of the footer when footer.wordwrap TRUE.

background.fill.color

Background color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

background.fill.opacity

Background opacity as an alpha value (0 to 1).

charting.area.fill.color

Charting area background color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

charting.area.fill.opacity

Charting area background opacity as an alpha value (0 to 1).

margin.top

Margin between plot area and the top of the graphic in pixels

margin.bottom

Margin between plot area and the bottom of the graphic in pixels

margin.left

Margin between plot area and the left of the graphic in pixels

margin.right

Margin between plot area and the right of the graphic in pixels

grid.show

Logical; whether to show grid lines.

values.title

Character, y-axis title; defaults to chart input values; to turn off set to "FALSE".

values.title.font.color

y-axis title font color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, max = 255)).

values.title.font.family

Character; y-axis title font family

values.title.font.size

y-axis title font size

values.line.width

y-axis line in pixels, 0 = no line

values.line.color

y-axis line color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

values.tick.mark.length

Length of tick marks in pixels.

values.bounds.minimum

Minimum of range for plotting; NULL = no manual range set. Must be less than values.bounds.maximum

values.bounds.maximum

Maximum of range for plotting; NULL = no manual range set. Must be greater than values.bounds.minimum

values.tick.distance

The distance between the ticks. Requires that values.bounds.minimum and values.bounds.maximum have been set.

values.tick.maxnum

Maximum number of ticks shown on the values axis.

values.tick.mark.color

Color of tick marks.

values.zero

Logical; whether a line should be shown when at values = 0.

values.zero.line.width

Width in pixels of zero line; 0 = no zero line shown

values.zero.line.color

Color of horizontal zero line as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

values.grid.width

Width of y-grid lines in pixels; 0 = no line

values.grid.color

Color of y-grid lines as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

values.tick.show

Whether to display the y-axis tick labels

values.tick.suffix

y-axis tick label suffix

values.tick.prefix

y-axis tick label prefix

values.tick.format

d3 formatting string applied to the tick labels. See https://github.com/mbostock/d3/wiki/Formatting#numbers

values.hovertext.format

d3 formatting string applied to the hover text. https://github.com/mbostock/d3/wiki/Formatting#numbers or

values.tick.angle

y-axis tick label angle in degrees. 90 = vertical; 0 = horizontal

values.tick.font.color

y-axis tick label font color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

values.tick.font.family

Character; y-axis tick label font family

values.tick.font.size

y-axis tick label font size

categories.tick.font.color

X-axis tick label font color as a named color in character format (e.g. "black") or an rgb value (e.g. rgb(0, 0, 0, maxColorValue = 255)).

categories.tick.font.family

Character; x-axis tick label font family

categories.tick.font.size

x-axis tick label font size

categories.tick.angle

Angle of the categories tick label.

categories.tick.label.wrap

Logical; whether to wrap long labels on the x-axis.

categories.tick.label.wrap.nchar

Integer; number of characters in each line when categories.tick.label.wrap is TRUE.

categories.tick.mark.length

Distance between tick labels (variable names) and axis. Note that this parameter name is chosen to be analgous to the same parameter in other charts, but it is not a a true "tick" label so categories.tick.mark.color is set as transparent.

hovertext.font.family

Font family of hover text.

hovertext.font.size

Font size of hover text.

hover.on

Only used for boxplot. If "all", then all the hovertext (for median, for the element near the cursor will be shown.

modebar.show

Logical; whether to show the zoom menu buttons or not.

Value

A plotly chart.

Examples

Box(rnorm(100))
Box(list(rnorm(100), rexp(100)))

Displayr/flipStandardCharts documentation built on Feb. 26, 2024, 12:42 a.m.