Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garthtarr/pairsD3
D3 scatterplot matrices
https://github.com/garthtarr/pairsD3
Last synced: 3 months ago
JSON representation
D3 scatterplot matrices
- Host: GitHub
- URL: https://github.com/garthtarr/pairsD3
- Owner: garthtarr
- Created: 2015-03-26T06:42:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-06-05T09:48:03.000Z (over 2 years ago)
- Last Synced: 2024-05-14T10:33:20.643Z (6 months ago)
- Language: R
- Homepage: http://garthtarr.github.io/pairsD3/
- Size: 3.38 MB
- Stars: 55
- Watchers: 6
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-shiny-extensions - pairsD3 - D3 scatterplot matrices. (Visualization / Scatterplot)
README
# D3 Scatterplot Matrices
[![Travis-CI Build Status](https://travis-ci.org/garthtarr/pairsD3.svg?branch=master)](https://travis-ci.org/garthtarr/pairsD3) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/pairsD3)](https://CRAN.R-project.org/package=pairsD3) [![](https://cranlogs.r-pkg.org/badges/pairsD3)](https://CRAN.R-project.org/package=pairsD3)
This is a port of Mike Bostock's [D3 scatter plot matrix](https://bl.ocks.org/mbostock/4063663) code to the [htmlwidgets](https://github.com/ramnathv/htmlwidgets) framework. There have been some minor adjustments, including the addition of tooltips.
You could also consider the [pairedVis()](https://healthvis.wordpress.com/2013/04/05/pairedvis/) function in the [healthvis](https://healthvis.wordpress.com/) package.
Take it for a test run [here](https://garthtarr.shinyapps.io/pairsD3/) (you can upload your own data).
## Installation
The `pairsD3` package is available on CRAN:
```s
install.packages("pairsD3")
```Alternatively, you can install the development version of `pairsD3` from Github using the `devtools` package as follows:
```s
devtools::install_github("garthtarr/pairsD3")
```## Usage
A canonical example with the iris data:
```s
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:
```s
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:
```s
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(' ')
```