Title: | D3 Scatterplot Matrices |
Version: | 0.1.3 |
Description: | Creates an interactive scatterplot matrix using the D3 JavaScript library. See https://d3js.org/ for more information on D3. |
Depends: | R (≥ 3.1.2) |
License: | GPL (≥ 3) |
Date: | 2022-06-05 |
URL: | https://github.com/garthtarr/pairsD3/ |
Imports: | htmlwidgets (≥ 0.3.2), shiny |
Suggests: | knitr |
RoxygenNote: | 7.2.0 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2022-06-05 06:22:59 UTC; garthtarr |
Author: | Garth Tarr [aut, cre], Mike Bostock [aut, cph] (d3.js library and much of pairsD3 code in htmlwidgets/lib, https://d3js.org) |
Maintainer: | Garth Tarr <garth.tarr@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2022-06-06 18:10:02 UTC |
D3 scatterplot matrices
Description
An interactive matrix of scatterplots is produced.
Usage
pairsD3(
x,
group = NULL,
subset = NULL,
labels = NULL,
cex = 3,
width = NULL,
col = NULL,
big = FALSE,
theme = "colour",
opacity = 0.9,
tooltip = NULL,
leftmar = 35,
topmar = 2,
diag = FALSE
)
Arguments
x |
the coordinates of points given as numeric columns of a
matrix or data frame. Logical and factor columns are converted
to numeric in the same way that |
group |
a optional vector specifying the group each observation belongs to. Used for tooltips and colouring the observations. |
subset |
an optional vector specifying a subset of observations to be used for plotting. Useful when you have a large number of observations, you can specify a random subset. |
labels |
the names of the variables (column names of |
cex |
the magnification of the plotting symbol (default=3) |
width |
the width (and height) of the plot when viewed externally. |
col |
an optional (hex) colour for each of the levels in the group vector. |
big |
a logical parameter. Prevents inadvertent plotting of huge
data sets. Default limit is 10 variables, to plot more than 10 set
|
theme |
a character parameter specifying whether the theme should
be colour |
opacity |
numeric between 0 and 1. The opacity of the plotting symbols (default 0.9). |
tooltip |
an optional vector with the tool tip to be displayed when hovering over an observation. You can include basic html. |
leftmar |
space on the left margin |
topmar |
space on the bottom margin |
diag |
logical, whether or not the main diagonal is plotted (scatter plot of variables against themselves). |
Examples
data(iris)
## Not run:
pairsD3(iris[,1:4],group=iris[,5],
labels=gsub(pattern = "\\.",replacement = " ", names(iris)))
## End(Not run)
Widget output function for use in Shiny
Description
Widget output function for use in Shiny
Usage
pairsD3Output(outputId, width = "100%", height = "400px")
Arguments
outputId |
Shiny output ID |
width |
width default '100%' |
height |
height default '400px' |
Widget render function for use in Shiny
Description
Widget render function for use in Shiny
Usage
renderPairsD3(expr, env = parent.frame(), quoted = FALSE)
Arguments
expr |
pairsD3 expression |
env |
environment |
quoted |
logical, default = FALSE |
Save a pairs plot to an HTML file
Description
Save a pairsD3 graph to an HTML file for sharing with others. The HTML can include it's dependencies in an adjacent directory or can bundle all dependencies into the HTML file (via base64 encoding).
Usage
savePairs(pairs, file, selfcontained = TRUE)
Arguments
pairs |
plot to save (e.g. result of calling the function
|
file |
File to save HTML into |
selfcontained |
Whether to save the HTML as a single self-contained file (with external resources base64 encoded) or a file with external resources placed in an adjacent directory. |
Shiny interface to the pairsD3 function
Description
Opens a shiny GUI to facilitate interaction with the pairsD3 function
Usage
shinypairs(x, group = NULL, subset = NULL, labels = NULL)
Arguments
x |
the coordinates of points given as numeric columns of a
matrix or data frame. Logical and factor columns are converted
to numeric in the same way that |
group |
a optional vector specifying the group each observation belongs to. Used for tooltips and colouring the observations. |
subset |
an optional vector specifying a subset of observations to be used for plotting. Useful when you have a large number of observations, you can specify a random subset. |
labels |
the names of the variables (column names of |
Examples
data(iris)
## Not run:
shinypairs(iris)
## End(Not run)