densplot_data_frame: Density Function for Data Frame

Description Usage Arguments See Also Examples

View source: R/density.R

Description

Plot density for object of class 'data.frame' using dens_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
densplot_data_frame(x, xvar, groups = NULL, facets = NULL,
  xlab = metOption("xlab_dens", "axislabel"), ref = metOption("ref_x_dens",
  "metaplot_ref"), ref.col = metOption("ref_col_dens", "grey"),
  ref.lty = metOption("ref_lty_dens", "solid"),
  ref.lwd = metOption("ref_lwd_dens", 1),
  ref.alpha = metOption("ref_alpha_dens", 1), log = metOption("log_dens",
  FALSE), crit = metOption("crit_dens", 1.3),
  aspect = metOption("aspect_dens", 1), scales = metOption("scales_dens",
  NULL), panel = metOption("panel_dens", "dens_panel"),
  points = metOption("points_dens", TRUE), colors = metOption("colors_dens",
  NULL), symbols = metOption("symbols_dens", NULL),
  sizes = metOption("sizes_dens", 1), lines = metOption("lines_dens", TRUE),
  types = metOption("types_dens", "solid"),
  widths = metOption("widths_dens", 1), fill = metOption("fill_dens",
  FALSE), space = metOption("space_dens", "right"),
  key = metOption("key_dens", "metaplot_key"),
  as.table = metOption("as.table_dens", TRUE), main = metOption("main_dens",
  NULL), sub = metOption("sub_dens", NULL),
  settings = metOption("settings_dens", NULL),
  padding = metOption("padding_dens", 1), gg = metOption("gg_dens", FALSE),
  verbose = metOption("verbose_dens", FALSE), ...)

Arguments

x

data.frame

xvar

variable to plot

groups

optional grouping variable

facets

optional conditioning variables

xlab

x axis label; can be function(x = x, var = xvar, log = log, ...)

ref

reference line; can be function(x = x, var = xvar, ...) or NULL to suppress

ref.col

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

ref.lty

type for reference line(s)

ref.lwd

size for reference line(s)

ref.alpha

transparency for reference line(s)

log

whether to log-transform x axis (auto-selected if NA)

crit

if log is NA, log-transform if mean/median ratio for non-missing x is greater than this value (and no negative values)

aspect

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

scales

passed to xyplot or facet_grid or facet_wrap (guessed if NULL)

panel

passed to densityplot

points

whether to plot points: logical or alpha, same length as groups

colors

replacements for default colors in group order; can be length one integer to auto-select that many colors

symbols

replacements for default symbols in group order

sizes

replacements for default symbol sizes in group order

lines

whether to plot lines: logical or alpha, same length as groups

types

replacements for default line types in group order

widths

replacements for default line widths in group order

fill

whether to fill curves: logical or alpha, same length as groups (symbol fill color is same as point color)

space

location of key (right, left, top, bottom)

key

list: passed to xyplot as auto.key or to theme; can be a function groups name, groups levels, points, lines, space, gg, and ... . See metaplot_key.

as.table

passed to xyplot

main

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

sub

character, or a function of x, xvar, groups, 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)

gg

logical: whether to generate ggplot instead of trellis

verbose

generate messages describing process

...

passed to densityplot

See Also

Other univariate plots: dens_panel, densplot.data.frame, densplot, metaplot.data.frame, panel.meta_densityplot

Other densplot: densplot.data.frame, densplot

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

Examples

1
2
3
4
5
6
7
densplot_data_frame(Theoph, 'conc', grid = TRUE)
densplot_data_frame(Theoph, 'conc', 'Subject')
densplot_data_frame(Theoph, 'conc', 'Subject',
space = 'top', columns = 4, legend.direction = 'horizontal')
densplot_data_frame(Theoph, 'conc', 'Subject',
space = 'top', columns = 4, legend.direction = 'horizontal', gg = TRUE)
densplot_data_frame(Theoph, 'conc', , 'Subject')

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