D3 Scatterplot Matrices

Creates an interactive scatterplot matrix using the D3 JavaScript library. See < http://d3js.org/> for more information on D3.


Version 0.0.8

This is a port of Mike Bostock's D3 scatter plot matrix code to the htmlwidgets framework. There have been some minor adjustments, including the addition of tooltips.

You could also consider the pairedVis() function in the healthvis package.

Take it for a test run here (you can upload your own data).

Installation

The pairsD3 package is available on CRAN:

install.packages("pairsD3")

Alternatively, you can install the development version of pairsD3 from Github using the devtools package as follows:

devtools::install_github("garthtarr/pairsD3")

Usage

A canonical example with the iris data:

data(iris)
require(pairsD3)
pairsD3(iris[,1:4],group=iris[,5])

Save

Use savePairs to save a pairs plot as a stand alone HTML file:

library(magrittr)
pairsD3(iris[,1:4],group=iris[,5]) %>% savePairs(file = 'iris.html')

Shiny

You can view an interactive scatterplot matrix using the shinypairs function:

shinypairs(iris)

Rmarkdown

You can include interactive scatterplot matrices in rmarkdown documents in the usual way:

```{r}
require(pairsD3)
pairsD3(iris)
```

Slidify

HTML widgets are not (yet) supported in slidify. A workaround is to do save the widget as a webpage then include that webpage in slidify using an iframe:

```{r, results='asis',echo=FALSE}
require(pairsD3)
pd3 = pairsD3(iris)
savePairs(pd3, 'pD3.html')
cat('<iframe src="pD3.html"> </iframe>')
```

News

Version 0.1.0

  • Specify d3 as a dependency and move it to its own folder. This is to ensure that d3 is picked up only once on a page, when multiple d3 based charts are used on a page. Thanks to Ramnath Vaidyanathan for this fix.
  • Namespace styles so that they are applied only to pairsD3 charts. Thanks to Ramnath Vaidyanathan for this fix.
  • Better handling of NA and NaN values. These are now dealt with on a pairwise basis.
  • Updated tooltip to show row number (name) and (optionally) the group an observation belongs to.
  • Improved the padding defaults and sizing.

Version 0.0.6

  • First CRAN release of pairsD3 package

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("pairsD3")

0.1.0 by Garth Tarr, 4 years ago


http://github.com/garthtarr/pairsD3/


Browse source code at https://github.com/cran/pairsD3


Authors: Garth Tarr [aut, cre]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports htmlwidgets, shiny

Suggests knitr


See at CRAN