sigd3: Significance Plot with D3 (vertical)

Description Usage Arguments Value

View source: R/daviz_functions.r

Description

Makes an errorbar plot using the D3.js library with a hover-over effect that highlights all cagtegories that are significantly differnet than the one being hovered over.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
sigd3(
  object,
  term,
  fname,
  height = 500,
  width = 625,
  return_iFrame = TRUE,
  level = 0.95,
  ylab = paste0("Effect of ", term),
  axfont = 12,
  labfont = 12,
  labfam = c("sans-serif", "serif"),
  colors = c("#B80000", "#000000", "#000000"),
  ptSize = c(7, 5),
  lineSize = c(3, 1.5),
  names = NULL,
  order = c("size-descending", "size-ascending", "natural")
)

Arguments

object

A model that has a categorical predictor. The function uses both ggpredict from the ggeffects package and factorplot from the factorplot package (with the variable given by the factor.var=term argument), so the object must be amenable to these manipulations. Alternatively, it could be an mcmc object in which case all columns will be plotted.

term

The term from the model to be plotted.

fname

Name of the file to which the html code will be written.

height

Height of the plot in pixels

width

Width of the plot in pixels

return_iFrame

Logical indicating whether an iframe should be returned to hold the plot. If FALSE only the html file is produced and the function prpduces no other visible output.

level

Confidence level at which to do the test (or in the mcmc case, credibility level for the credible intervals).

ylab

Label to put on y-axis.

axfont

Font size for axis tick mark labels (in px).

labfont

Font size for y-axis label (in px).

labfam

Font-family for y-axis label (must be one of "serif" or "sans-serif").

colors

Vector of three colors the first for the selected items, the second for the un-selected items and the third for when no points are hovered over.

ptSize

Vector of two point sizes - the first for selected observations and the second for unselected ones.

lineSize

Vector of line widths - the first for selected observations and the second for unselected ones.

names

An optional vector of names for the parameters.

order

How should parameters be organized by size-ascending, size-descending or natural (i.e., the order in the data).

Value

Either an html file or an iframe linked to the html file.


davidaarmstrong/daviz documentation built on Aug. 13, 2020, 3:07 p.m.