Learn R Programming

rtemis (version 0.79)

dplot3: Dynamic Plots (plotly)

Description

Build dynamic plots that can be viewed in RStudio Viewer, a web browser, or exported to a static image. Support for (x, y) scatter plots with optional fit line(lm, or gam), and density plots.

Usage

dplot3(x, y = NULL, mode = NULL, group = NULL, point.size = 7,
  point.color = NULL, point.alpha = 0.66, point.symbol = "circle",
  point.labels = NULL, fit = "none", axes.fixedratio = FALSE,
  xlim = NULL, ylim = NULL, gam.k = 4, fit.width = 3,
  fit.color = "#18A3AC", fit.alpha = 1, se.fit = TRUE,
  se.times = 2, se.color = NULL, se.alpha = 0.2,
  density.color = "#18A3AC", density.alpha = 0.66, density.width = 1,
  density.mean = FALSE, density.mean.width = 2, main = NULL,
  xlab = "x", ylab = "y", font.family = "Helvetica Neue",
  font.color = "gray50", font.size = 18, axes = FALSE, grid = TRUE,
  grid.col = "#fff", zero.lines = TRUE, zero.col = "#7F7F7F",
  zero.lwd = 1, legend = TRUE, legend.bgcol = "#00000000",
  legend.bordercol = "gray50", legend.borderwidth = 0,
  legend.fontcol = "#000000", margins = c(60, 70, 40, 20), pad = 4,
  bg = "#E5E5E5", showlegend = TRUE, legend.xy = c(0, 1),
  axes.square = FALSE, height = NULL, width = NULL)

Arguments

x

Numeric vector. x coordinates

y

Numeric vector. y coordinates

mode

String: "scatter" or "density"

group

String: Name of variable to group by (not yet functional)

point.size

Numeric scalar or vector

point.color

Color of points

point.alpha

Float: Alpha of points

point.symbol

String: "circle", "square"; see plotly documentation for more Default = "circle"

point.labels

String, optional: Point labels displayed on mouse over

fit

String, optional: "lm", "gam"

gam.k

Integer: Number of bases for mgcv::gam's smoothing spline

fit.width

Float: Width of fit line

fit.color

Color of fit line

fit.alpha

Float: Alpha of fit line

se.fit

Logical: If TRUE, draws +/- se.times * standard error

se.times

Float: Multiplier for standard error band. Default = 2

se.color

Color of S.E. band

se.alpha

Float: Alpha of S.E. band

density.color

Color of density line

density.alpha

Float: Alpha of density line

density.width

Integer: Width of density line

density.mean

Logical: If TRUE, draw vertical line at mean(x)

density.mean.width

Integer: Width of density.mean line. Default = 2

main

String: Plot title

xlab

String: x-axis label

ylab

String: y-axis label

font.family

String: Axes' legends' font family

font.color

Font color

font.size

Integer: Font size

axes

Logical: If TRUE, show x and y axes. Default = TRUE

grid

Logical: If TRUE, draw grid lines. Default = FALSE

pad

Numeric: Distance of tick labels from axes

showlegend

Logical: If TRUE, show legends

legend.xy

Vector, length 2 [0, 1]: x, y coordinates of legend. 0 means left and bottom for x and y axis respectively; 1 means right and top. Default = c(0, 1) (i.e. top-left)

axes.square

Logical: If TRUE, make axes square

margin

Vector, length 4: Plot margins. Default = c(60, 70, 40, 20)

See Also

mplot3