Description Usage Arguments Examples
View source: R/lipidome_comparison_pca.R
'plot_pc_variance' prints a barplot with a line of the contribution of principal components to the data variance
1 2 3 4 5 6 7 8 9 10 | plot_pc_variance(
data_frame,
x,
y,
xlab = "dimensions",
ylab = "variance [%]",
title = "Scree plot",
fill = "#35608DFF",
hjust = -0.2
)
|
data_frame |
data frame. Contains eigenvalues, contribution to data variance and cummulative contribution to data variance for a PCA model. |
x |
column of data_frame. Column with principal component names. |
y |
column of data_frame. Column with eigenvalues/contribution to variance/ cummulative contribution to variance. |
xlab |
string. X-axis label. Default: "dimensions" |
ylab |
string. X-axis label. Default: "variance [%]" |
title |
string. Main title. Default: "Scree plot" |
fill |
string. Color of the barplot. Default: "#35608DFF" |
hjust |
numeric. Position of labels relative to the points in the graph. Default: -0.2 |
1 2 3 | {iris_pca <- FactoMineR::PCA(dplyr::select_if(iris, is.numeric))
iris_eigen <- as.data.frame(factoextra::get_eigenvalue(iris_pca))
plot_pc_variance(iris_eigen, x = rownames(iris_eigen), y = iris_eigen$cumulative.variance.percent)}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.