htmlwidgets is an R package to facilitate the use of javascript-based data visualization from R.
This testjs package is a trial run for me to play with, as I learn to use htmlwidgets.
Install testjs from its GitHub repository. You first need to install the devtools and htmlwidgets packages.
install.packages(c("devtools", "htmlwidgets"))
Then install testjs using the install_github
function in the
devtools package.
library(devtools)
install_github("kbroman/testjs")
There's just one function, iplot
, for an interactive
scatterplot. Here's an example of its use:
library(testjs)
x <- rnorm(100)
grp <- sample(1:3, 100, replace=TRUE)
y <- x*grp + rnorm(100)
iplot(x, y, grp)
Licensed under the MIT license. (More information here.)
testjs incorporates D3.js (see its license), d3.tip (see its license), and ColorBrewer (see its license).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.