Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/marginal.plot.R
Display marginal distributions of several variables, which may be numeric and/or categorical, on one plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | marginal.plot(x,
data = NULL,
groups = NULL,
reorder = !is.table(x),
plot.points = FALSE,
ref = TRUE, cut = 0,
origin = 0,
xlab = NULL, ylab = NULL,
type = c("p", if (is.null(groups)) "h"),
...,
subset = TRUE,
as.table = TRUE,
subscripts = TRUE,
default.scales = list(
relation = "free",
abbreviate = TRUE, minlength = 5,
rot = 30, cex = 0.75, tick.number = 3,
y = list(draw = FALSE)),
layout = NULL,
lattice.options = list(
layout.heights = list(
axis.xlab.padding = list(x = 0),
xlab.key.padding = list(x = 0))))
|
x |
a data frame or table, or a formula of which the first term
is a data frame or table. Otherwise coerced with
|
data |
an optional data source in which groups and subset may be be evaluated. |
groups |
term, to be evaluated in |
reorder |
whether to reorder factor variables by frequency. |
subset |
data subset expression, evaluated in |
plot.points, ref, cut |
passed to |
origin, type |
passed to |
xlab, ylab, as.table, subscripts |
see |
default.scales, layout, lattice.options |
see |
... |
passed to |
In the case of mixed numeric and categorical variables,
the trellis objects from dotplot()
and densityplot()
are merged.
a trellis object.
Felix Andrews felix@nfrac.org
panel.dotplot
,
panel.densityplot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | enviro <- environmental
## make an ordered factor (so it will not be reordered)
enviro$smell <- cut(enviro$ozone, breaks = c(0, 30, 50, Inf),
labels = c("ok", "hmmm", "yuck"), ordered = TRUE)
marginal.plot(enviro)
## using groups
enviro$is.windy <- factor(enviro$wind > 10,
levels = c(TRUE, FALSE), labels = c("windy", "calm"))
marginal.plot(enviro[,1:5], data = enviro, groups = is.windy,
auto.key = list(lines = TRUE))
## support for tables
marginal.plot(Titanic)
## table with groups
marginal.plot(~ Titanic, data = Titanic, groups = Survived,
type = "b", auto.key = list(title = "Survived?"))
|
Loading required package: lattice
Loading required package: RColorBrewer
Warning message:
In formals(fun) : argument is not a function
Warning message:
In formals(fun) : argument is not a function
Warning messages:
1: In formals(fun) : argument is not a function
2: In formals(fun) : argument is not a function
3: In formals(fun) : argument is not a function
Warning messages:
1: In formals(fun) : argument is not a function
2: In formals(fun) : argument is not a function
3: In formals(fun) : argument is not a function
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.