Boxplot for data.frame. Creates a boxplot using boxplot_panel
by default.
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),
...
)
data.frame
y variable
x variable
optional conditioning variables
whether to log transform numeric variable (auto-selected if NA)
if log is NA, log-transform if mean/median ratio for non-missing values is greater than this value
whether box/whisker axis should be horizontal (numeric x, categorical y); defaults TRUE if var[[2]] is numeric
passed to xyplot
(should be function(x = x, horizontal, log,...)) or facet_grid
or facet_wrap
panel function
optional reference line(s) on numeric axis; can be function(x = x, var = con, ...) or NULL to suppress
color for reference line(s); can be length one integer to auto-select that many colors
line type for reference line(s)
line size for reference line(s)
transparency for reference line(s)
whether to include the number of observations under the category label
whether to remove data points with one or more missing coordinates
x axis label
y axis label
numeric axis label; can be function(x = x, var = numvar, log = ylog, ...)
categorical axis label; can be function(x = x, var = catvar, ...)
passed to bwplot
or ggplot; use 'fill', NA, or NULL to calculate automatically
passed to xyplot
character, or a function of x, yvar, xvar, facets, and log
character, or a function of x, yvar, xvar, facets, and log
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).
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)
if y is categorical, present levels in reverse order (first at top)
special character for box median: passed to panel.bwplot
whether to draw notched boxes: passed to panel.bwplot
logical: whether to generate ggplot
instead of trellis
generate messages describing process
passed arguments
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()
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)
Run the code above in your browser using DataLab