
Plot the variance explained by the principal components
Source:R/plot_mds.R
plot_explained_variance.RdPlots the proportion of the variance explained by each
principal component of a principal component analysis (PCA) of the
samples, computed on the log2 normalized counts (with the
normalization chosen in normalize_data) with
compute_explained_variance. It shows how many components
are needed to describe the differences between the samples. The
samples on the components are shown by plot_pca.
Arguments
- screenR_Object
The ScreenR object obtained using
create_screenr_object.- cumulative
Whether to plot the cumulative proportion of variance instead of the proportion of each component. Default FALSE.
- color
The fill color of the bars. Default "steelblue".
Examples
object <- get0("object", envir = asNamespace("ScreenR"))
plot_explained_variance(object)
# Cumulative variance
plot_explained_variance(object, cumulative = TRUE)