This function performs principal component analysis.
PCA_function(
data,
scale = TRUE,
text = TRUE,
pointsize = 5,
textsize = 12,
labelsize = 4,
linesize = 0.6,
repel = TRUE,
ylab = NA,
xlab = NA,
groups = NA,
sc = 1,
font.family = "sans",
theme = theme_bw(),
label.legend = "Cluster",
type.graph = "biplot"
)
The eigenvalues and eigenvectors, the explanation percentages of each principal component, the correlations between the vectors with the principal components, as well as graphs are returned.
Data.frame with data set. Line name must indicate the treatment
Performs data standardization (default is TRUE)
Add label (default is TRUE)
Point size (default is 5)
Text size (default is 12)
Label size (default is 4)
Line size (default is 0.8)
Avoid text overlay (default is TRUE)
Names y-axis
Names x-axis
Define grouping
Secondary axis scale ratio (default is 1)
Font family (default is sans)
Theme ggplot2 (default is theme_bw())
Legend title (when group is not NA)
Type of chart (default is biplot)
Gabriel Danilo Shimizu
The type.graph argument defines the graph that will be returned, in the case of "biplot" the biplot graph is returned with the first two main components and with eigenvalues and eigenvectors. In the case of "scores" only the treatment scores are returned, while for "cor" the correlations are returned. For "corPCA" a correlation between the vectors with the components is returned.
data(pomegranate)
medias=tabledesc(pomegranate)
PCA_function(medias)
Run the code above in your browser using DataLab