View source: R/selectable_scatter_plot.R
selectable_scatter_plot | R Documentation |
A scatterplot with dropdown menus to select both the x & y variables and the variable used to colour the points.
selectable_scatter_plot(coords, colours, title = "", select_first = NULL)
pca_selectable_scatter_plot(mat, df, ...)
coords |
data.frame or matrix of point co-ordinates Each column will be an entry in the X and Y drop-down menus |
colours |
data.frame of variables used to colour points |
title |
Plot title. |
select_first |
Variable to use as default colour when plot is loaded. |
mat |
Matrix to calculate PCs. |
df |
|
... |
Passed to |
pcs <- prcomp(mtcars)
colours <- mtcars[, c("cyl", "vs", "am", "gear", "carb")]
colours[] <- lapply(colours, as.character)
selectable_scatter_plot(
pcs$x,
colours,
"Interactive PCA plot"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.