Description Usage Arguments Details Author(s) Examples
Generates typical 3D dimension reduction data
1 | Gen.dr.data(type, N=1000)
|
type |
one of "swissroll", "scurve" (S-curve), "helix", "ssphere" (severed sphere) |
N |
number of data points |
'Gen.dr.data()' generates some frequently used 3D data. Formulas taken partly from 'tapkee' 'borsch' script and partly from Python 'scikit-learn'.
Alexey Shipunov
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # generate four variants of 3D data
SC <- Gen.dr.data("scurve")
SR <- Gen.dr.data("swissroll")
HX <- Gen.dr.data("helix")
SS <- Gen.dr.data("ssphere")
# plot them (requires packages 'scatterplot3d' and 'rgl')
if (requireNamespace("rgl", quietly = TRUE)) {
COL <- colorRampPalette(c("green", "orange"))(1000)
scatterplot3d::scatterplot3d(SC, color=COL, pch=20, cex.symbols=1.4)
} else {
cat("Please install 'rgl' package to see the plot")
}
if (requireNamespace("rgl", quietly = TRUE)) {
rgl::plot3d(SR, col=rainbow(1100))
} else {
cat("Please install 'rgl' package to see the plot")
}
if (requireNamespace("rgl", quietly = TRUE)) {
rgl::plot3d(HX, col=rainbow(1100))
} else {
cat("Please install 'rgl' package to see the plot")
}
if (requireNamespace("rgl", quietly = TRUE)) {
rgl::plot3d(SS, col=rainbow(1100))
} else {
cat("Please install 'rgl' package to see the plot")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.