View source: R/dsldScatterPlot3D.R
dsldScatterPlot3D | R Documentation |
Plotly 3D visualization of a dataset on 3 axes, with points color-coded on a 4th variable.
dsldScatterPlot3D(data, yNames, sName, sGroups = NULL, sortedBy =
"Name", numGroups = 8, maxPoints = NULL, xlim = NULL,
ylim = NULL, zlim = NULL, main = NULL, colors =
"Paired", opacity = 1, pointSize = 8)
data |
Data frame with at least 4 columns. |
yNames |
Vector of the indices or names of the columns of the data frame to be graphed on the 3 axes. |
sName |
Index or name of the column that contains the groups for which the data will be grouped by. This will affect the colors of the points of the graph. This column must be an R factor. |
sGroups |
Vector of the names of the groups for which the data will be grouped by.
Every value in the vector must exist in the |
sortedBy |
Controls how "Name" gets the first values alphabetically. "Frequency" gets the most frequently occuring values. "Frequency-Descending" gets the least frequently occuring values. |
numGroups |
Number of groups to be automatically generated by the function. If
|
maxPoints |
Limit to how many points may be displayed on the graph. There is no limit by default. |
xlim , ylim , zlim |
The x, y and z limits, each a vector with c(min, max). |
main |
The title of the graph. By default, the |
colors |
Either a colorbrewer2.org palette name (e.g. "YlOrRd" or "Blues"), or a vector of colors to interpolate in hexadecimal "#RRGGBB" format, or a color interpolation function like colorRamp(). |
opacity |
A value between 0 and 1. |
pointSize |
A value above 1. |
An interactive Plotly visualization will be created, with the three
variables specified in yNames
. Points will be color-coded
according to sName
. The plot can be rotated etc. using the mouse.
No value, plot.
J. Tran and B. Zarate
https://plotly.com/r/3d-scatter-plots/
data(lsa)
dsldScatterPlot3D(lsa,sName = "race1",
yNames=c("ugpa", "lsat","age"), xlim=c(2,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.