boxplot_data_frame: Boxplot Function for Data Frame

Description Usage Arguments See Also Examples

View source: R/box.R

Description

Boxplot for data.frame. Creates a boxplot using boxplot_panel by default.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
boxplot_data_frame(x, yvar, xvar, facets = NULL,
  log = metOption("log_boxplot", FALSE), crit = metOption("crit_boxplot",
  1.3), horizontal = metOption("horizontal_boxplot", NULL),
  scales = metOption("scales_boxplot", NULL),
  panel = metOption("panel_boxplot", "boxplot_panel"),
  ref = metOption("ref_boxplot", "metaplot_ref"),
  ref.col = metOption("ref.col_boxplot", "grey"),
  ref.lty = metOption("ref.lty_boxplot", "solid"),
  ref.lwd = metOption("ref.lwd_boxplot", 1),
  ref.alpha = metOption("ref.alpha_boxplot", 1),
  nobs = metOption("nobs_boxplot", FALSE),
  na.rm = metOption("na.rm_boxplot", TRUE), xlab = NULL, ylab = NULL,
  numlab = metOption("numlab_boxplot", "axislabel"),
  catlab = metOption("catlab_boxplot", "axislabel"),
  aspect = metOption("aspect_boxplot", 1),
  as.table = metOption("as.table_boxplot", TRUE),
  main = metOption("main_boxplot", NULL), sub = metOption("sub_boxplot",
  NULL), settings = metOption("settings_boxplot", NULL),
  padding = metOption("padding_boxplot", 1),
  reverse = metOption("reverse_boxplot", TRUE),
  pch = metOption("pch_boxplot", "|"), notch = metOption("notch_boxplot",
  FALSE), gg = metOption("gg_boxplot", FALSE),
  verbose = metOption("verbose_boxplot", FALSE), ...)

Arguments

x

data.frame

yvar

y variable

xvar

x variable

facets

optional conditioning variables

log

whether to log transform numeric variable (auto-selected if NA)

crit

if log is NA, log-transform if mean/median ratio for non-missing values is greater than this value

horizontal

whether box/whisker axis should be horizontal (numeric x, categorical y); defaults TRUE if var[[2]] is numeric

scales

passed to xyplot (should be function(x = x, horizontal, log,...)) or facet_grid or facet_wrap

panel

panel function

ref

optional reference line(s) on numeric axis; can be function(x = x, var = con, ...) or NULL to suppress

ref.col

color for reference line(s); can be length one integer to auto-select that many colors

ref.lty

line type for reference line(s)

ref.lwd

line size for reference line(s)

ref.alpha

transparency for reference line(s)

nobs

whether to include the number of observations under the category label

na.rm

whether to remove data points with one or more missing coordinates

xlab

x axis label

ylab

y axis label

numlab

numeric axis label; can be function(x = x, var = numvar, log = ylog, ...)

catlab

categorical axis label; can be function(x = x, var = catvar, ...)

aspect

passed to bwplot or ggplot; use 'fill', NA, or NULL to calculate automatically

as.table

passed to xyplot

main

character, or a function of x, yvar, xvar, facets, and log

sub

character, or a function of x, yvar, xvar, facets, and log

settings

default parameter settings: a list from which matching elements are passed to lattice (as par.settings) or to ggplot theme() and facet_wrap() or facet_grid(). ncol and nrow are used as layout indices for lattice (for homology with facet_wrap).

padding

numeric (will be recycled to length 4) giving plot margins in default units: top, right, bottom, left (in multiples of 5.5 points for ggplot)

reverse

if y is categorical, present levels in reverse order (first at top)

pch

special character for box median: passed to panel.bwplot

notch

whether to draw notched boxes: passed to panel.bwplot

gg

logical: whether to generate ggplot instead of trellis

verbose

generate messages describing process

...

passed arguments

See Also

Other mixedvariate plots: boxplot.data.frame, boxplot_panel

Other boxplot: boxplot.data.frame

Other metaplot: categorical_data_frame, corsplom_data_frame, densplot_data_frame, metaplot_key, metaplot, scatter_data_frame, test_metaplot

Examples

1
2
3
4
5
library(magrittr)
library(dplyr)
boxplot_data_frame(Theoph,'Subject','conc')
boxplot_data_frame(Theoph %>% filter(conc > 0),
'conc','Subject', log = TRUE, ref = c(2,5),horizontal = FALSE)

Example output

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

metaplot documentation built on May 1, 2019, 10:17 p.m.