This package provides a interactive rug plot: it plots the values of a labelled numeric vector. d3rug is inspired by the strip plot of Maarten Lambrechts

library(d3rug)
income <- state.x77[,2]
d3rug(income, height="100px")

The user can see the labels of the values by moving the mouse to the value.

The d3rug function can be tuned and adapted in the following ways:

illiteracy_levels <- cut(state.x77[,3], 5)
pal <- colorRampPalette(c("green","gray", "orange"))(nlevels(illiteracy_levels))
col = pal[illiteracy_levels]
d3rug(income, col=col)

You can supply your own labels:

d3rug(income, labels=state.abb)
d3rug(income, col_hover = "red")
group <- substr(state.abb, 1, 1)
d3rug(income, col_hover = "red", group = group)


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