plot.ppgmmga {ppgmmga} | R Documentation |
Plots the data onto the projection subspace estimated by the ppgmmga algorithm
Description
Plot method for objects of class 'ppgmmga'
.
Usage
## S3 method for class 'ppgmmga'
plot(x,
class = NULL,
dim = seq(x$d),
drawAxis = TRUE,
bins = nclass.numpy,
...)
Arguments
x |
An object of class |
class |
A numeric or character vector indicating the classification of the observations/cases to be plotted. |
dim |
A numeric vector indicating the dimensions to use for plotting.
By default, all the dimensions of the projection subspace (i.e. |
drawAxis |
A logical value specifying whether or not the axes should be included in the 2D scatterplot. By default is to |
bins |
An R function to be used for computing the number of classes for the histogram. By default |
... |
further arguments. |
Details
Plots the cloud of points onto a subspace after appling the Projection Pursuit algorithm based on Gaussian mixtures and Genetic algorithm implemented in ppgmmga
function.
Value
Returns a object of class ggplot
.
Author(s)
Serafini A. srf.alessio@gmail.com
Scrucca L. luca.scrucca@unipg.it
References
Scrucca, L. and Serafini, A. (2019) Projection pursuit based on Gaussian mixtures and evolutionary algorithms. Journal of Computational and Graphical Statistics, 28:4, 847–860. DOI: 10.1080/10618600.2019.1598871
See Also
Examples
## Not run:
data(iris)
X <- iris[,-5]
Class <- iris$Species
# 1D
pp1 <- ppgmmga(data = X, d = 1, approx = "UT")
summary(pp1, check = TRUE)
plot(pp1)
plot(pp1, Class)
# 2D
pp2 <- ppgmmga(data = X, d = 2, approx = "UT")
summary(pp2, check = TRUE)
plot(pp2)
plot(pp2, Class)
# 3D
pp3 <- ppgmmga(data = X, d = 3)
summary(pp3, check = TRUE)
plot(pp3)
plot(pp3, Class)
plot(pp3, Class, dim = c(1,3))
plot(pp3, Class, dim = c(2,3))
## End(Not run)