# example 1: visualize random 3D input data
mat <- matrix(runif(99, 0, 3), ncol=3)
# create random class assignment vector with three classes
y <- round(runif(33, 0, 2))
y <- ifelse(y == 0, "class 1", ifelse(y == 1, "class 2", "class 3"))
# create ouput using numbers from 1 to length(y) as metalabels
vcloud(mat, y, metalabels=1:length(y), col.axis="black", col.lab="blue",
col.bg="white", htmlout="result.html")
# example 2: scaled parametric plot of a sphere
p <- seq(-pi,pi, length=30)
x <- c(rep(1, 30) %*% t(cos(p)))
y <- c(cos(p) %*% t(sin(p)))
z <- c(sin(p) %*% t(sin(p)))
vcloud(cbind(x,y,z), scalefac=7)
# example 3: visualization of Edgar Anderson's Iris data
# using density estimation contour surfaces (requires misc3-package!)
irismat <- iris[,1:3]
vcloud(irismat, labels=iris[,5], showdensity=TRUE,
col.bg="white", col.axis="blue", col.lab="black",
lab.axis=colnames(irismat))
Run the code above in your browser using DataLab