d3rug: Interactive Rug plot

Description Usage Arguments Examples

Description

d3rug creates an interactive rug plot. The rugplot is heavily inspired by the Lambrechts Strip Plot (reference).

Usage

1
2
3
4
d3rug(values, labels = names(values), col = "steelblue", col_hover = col,
  alpha = 0.3, unit = NULL, group = NULL, select = NULL,
  col_select = "red", main = deparse(substitute(values)), ...,
  width = "100%", height = "150px")

Arguments

values

numeric with values to be plotted

labels

character of same lenght as values. These will be used to annotate a value when hovered.

col

character with colors. Either a scalar or length of values.

col_hover

character with colors used for coloring hovered values.

alpha

transparancy of values which are not hovered or selected.

unit

character text to be appended to value.

group

optional character that is used to highlight the group of values that are hovered or selected

select

optional character specifying which label is selected

col_select

character with color used for selected values.

main

title of the plot

...

extra parameters

width

width of plot

height

height of plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(d3rug)
income <- state.x77[,2]
d3rug(income, height="100px")
illiteracy_levels <- cut(state.x77[,3], 5)
pal <- colorRampPalette(c("green","gray", "orange"))(nlevels(illiteracy_levels))
col = pal[illiteracy_levels]
d3rug(income, color=col)

## End(Not run)

edwindj/d3rug documentation built on May 15, 2019, 11:04 p.m.