Learn R Programming

Anthropometry (version 1.2)

shapes3dShapes: 3D shapes plot

Description

This function is a slight modification of the original shapes3d function of the shapes R package so that the resulting plot has customized title and axes. Specifically, the changing lines regarding the original function are those related to its argument axes3 when it is fixed to TRUE.

Usage

shapes3dShapes(x,loop=0,type="p",color=2,joinline=c(1:1),
               axes3=FALSE,rglopen=TRUE,main=main)

Arguments

x
loop
type
color
joinline
axes3
rglopen
main
Allows us to give the plot a title if axes3=TRUE.

Value

  • A device with the desired plot.

References

Dryden, I. L., (2012). shapes package. R Foundation for Statistical Computing, Vienna, Austria. Contributed package.

Dryden, I. L., and Mardia, K. V., (1998). Statistical Shape Analysis, Wiley, Chichester.

See Also

shapes3d

Examples

Run this code
#CLUSTERING INDIVIDUALS ACCORDING TO THEIR SHAPE:
landmarksNoNa <- na.exclude(landmarksSampleSpaSurv)
dim(landmarksNoNa) 
#[1] 574 198 
numLandmarks <- (dim(landmarksNoNa)[2]) / 3
#[1] 66
#In the interests of simplicity of the computation involved:
landmarksNoNa_First50 <- landmarksNoNa[1 : 50, ] 
(numIndiv <- dim(landmarksNoNa_First50)[1])
#[1] 50         
    
array3D <- array3Dlandm(numLandmarks, numIndiv, landmarksNoNa_First50)

numClust <- 3 ; algSteps <- 5 ; niter <- 3 ; stopCr <- 0.0001
set.seed(2013)
resHA <- HartiganShapes(array3D,numClust,algSteps,niter,stopCr,FALSE,FALSE,c(),TRUE)

prototypes <- anthrCases("anthropometry", "kmeansProcrustes", resHA)

shapes3dShapes(prototypes[,,1], loop = 0, type = "p", color = 2, joinline = c(1:1), 
            axes3 = TRUE, rglopen = TRUE, main = "Mean shape cluster 1")

Run the code above in your browser using DataLab