plot.i_pca: Plotting 2D maps in Principal Component Analysis

View source: R/plot.i_pca.r

plot.i_pcaR Documentation

Plotting 2D maps in Principal Component Analysis


Graphical display of Principal Component Analysis results in two dimensions


## S3 method for class 'i_pca'
plot(x, dims = c(1,2), what = c(TRUE,TRUE), 
dataname = NULL, labels = NULL, animation = TRUE, frames = 10, 
zoom = TRUE, movie_format = "gif", ...)



Principal component analysis object returned by i_pca


Numerical vector of length 2 indicating the dimensions to plot on horizontal and vertical axes respectively; default is first dimension horizontal and second dimension vertical


Vector of two logicals specifying the contents of the plot(s). First entry indicates if the scatterplot of observations is displayed and the second entry if the correlation circle of the variable loadings is displayed (default = c(TRUE,TRUE) and shows both plots)


String prefix used for custom naming of output files; default is the name of the output object


String vector of variable labels


Logical indicating whether animated GIF or PDF files are created and saved to the hard drive or a static plot is created (default = TRUE)


Number of animation frames shown per iteration (default = 10); applicable only when animation = TRUE


Logical indicating whether axes limits change during the animation creating a zooming effect; applicable only when animation = TRUE


Specifies if the animated plot is saved in the working directory either in default = "gif" or "pdf" format


Further arguments passed to plot and points


The function plot.i_pca makes a two-dimensional map of the object created by i_pca with respect to two selected dimensions.


ImageMagick:; GraphicsMagick:

See Also



data("iris", package = "datasets")
#standardize variables
X = scale(iris[,-5])
res_iPCA = i_pca(data1 = X[1:50,-5], data2 = X[51:150,-5], nchunk = c(50,50))
#static plot, final solution
plot(res_iPCA, animation = FALSE)

##\donttest is used here because the code calls the saveLatex function of the animation package 
#which requires ImageMagick or GraphicsMagick and 
#Adobe Acrobat Reader to be installed in your system 
#See help(im.convert) for details on the configuration of ImageMagick or GraphicsMagick.
#Creates animated plots in PDF for objects and variables
plot(res_iPCA, animation = TRUE, frames = 10, movie_format = 'pdf')

idm documentation built on July 12, 2022, 1:05 a.m.

Related to plot.i_pca in idm...