scattergram: Scattergram

Description Usage Arguments Examples

View source: R/plot.R

Description

A scattergram plot with density curves along axes.

Usage

1
2
scattergram(x, y, g = NULL, col = NULL, ..., xlim = NULL, ylim = NULL,
  axs = "i", main = NULL, legend = TRUE, args.legend = list())

Arguments

x, y, g

the x-, y-, and group variables

col

a vector of colors or integers for each unique value of g

...

additional arguments passed to plot (e.g., xlim, panel.first) or further to par

xlim, ylim

the x- and y-axis limits

axs

the style(s) of axis interval calculation; see par

main

the main figure title

legend

logical; if TRUE, a group legend is drawn

args.legend

a named list of legend arguments to override defaults

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
with(mtcars, {
  scattergram(mpg, wt)
})

with(mtcars, {
  scattergram(mpg, wt, cyl, col = rainbow(3), pch = 16)
})

with(mtcars, {
  scattergram(
    mpg, wt, c('Four', 'Six', 'Eight')[cyl / 2 - 1],
    xlab = 'MPG', ylab = 'Weight', las = 1,
    panel.first = abline(lm(wt ~ mpg), col = 5, lwd = 3),
    panel.last = abline(v = c(20, 25))
  )
})

raredd/plotr documentation built on Nov. 13, 2018, 7:05 a.m.