ScatterHistC | R Documentation |
Plot a scatter plot conditioned on a discrete variable, with marginal conditional density plots.
ScatterHistC(
frame,
xvar,
yvar,
cvar,
title,
...,
annot_size = 3,
colorPalette = "Dark2",
adjust_x = 1,
adjust_y = 1
)
frame |
data frame to get values from |
xvar |
name of the x variable |
yvar |
name of the y variable |
cvar |
name of condition variable |
title |
title to place on plot |
... |
no unnamed argument, added to force named binding of later arguments. |
annot_size |
numeric scale annotation text (if present) |
colorPalette |
name of a Brewer palette (see https://colorbrewer2.org/ ) |
adjust_x |
numeric: adjust x density plot |
adjust_y |
numeric: adjust y density plot |
xvar
and yvar
are the coordinates of the points, and cvar
is the
discrete conditioning variable that indicates which category each point (x,y) belongs to.
plot grid
ScatterHist
if (requireNamespace('data.table', quietly = TRUE)) {
# don't multi-thread during CRAN checks
data.table::setDTthreads(1)
}
set.seed(34903490)
frm = data.frame(x=rnorm(50),y=rnorm(50))
frm$cat <- frm$x+frm$y>0
WVPlots::ScatterHistC(frm, "x", "y", "cat",
title="Example Conditional Distribution")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.