Gen.dr.data {tapkee} | R Documentation |
Generates 3D data
Description
Generates typical 3D dimension reduction data
Usage
Gen.dr.data(type, N=1000)
Arguments
type |
one of "swissroll", "scurve" (S-curve), "helix", "ssphere" (severed sphere) |
N |
number of data points |
Details
'Gen.dr.data()' generates some frequently used 3D data. Formulas taken partly from 'tapkee' 'borsch' script and partly from Python 'scikit-learn'.
Author(s)
Alexey Shipunov
Examples
# 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")
}
[Package tapkee version 1.2 Index]