gl.report.factorloadings {dartR.base} | R Documentation |
Reports factor loadings for a PCA or PCoA
Description
Extracts the factor loadings from a glPCA object (generated by gl.pcoa) and plots their distribuion.
Usage
gl.report.factorloadings(
pca,
axis = 1,
n.display = 15,
plot.display = TRUE,
plot.theme = theme_dartR(),
plot.colors = NULL,
plot.file = NULL,
plot.dir = NULL,
bins = 25,
verbose = NULL,
...
)
Arguments
pca |
Name of the glPCA object containing factor loadings [required]. |
axis |
Axis in the ordination used to display the factor loadings [default 1] |
n.display |
Number of loci for which to display factorloadings [default 15] |
plot.display |
If TRUE, resultant plots are displayed in the plot window [default TRUE]. |
plot.theme |
Theme for the plot. See Details for options [default theme_dartR()]. |
plot.colors |
List of two color names for the borders and fill of the plots [default c("#2171B5","#6BAED6")]. |
plot.file |
Name for the RDS binary file to save (base name only, exclude extension) [default NULL] |
plot.dir |
Directory to save the plot RDS files [default as specified by the global working directory or tempdir()] |
bins |
Number of bins to display in histograms [default 25]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, unless specified using gl.set.verbosity] |
... |
Parameters passed to function ggsave, such as width and height, when the ggplot is to be saved. |
Details
The function extracts the factor loadings for a given axis from a PCA object generated by gl.pcoa and plots their magnitudes. Useful for identifying loci that load high for a given axis.
A color vector can be obtained with gl.select.colors() and then passed to the function with the plot.colors parameter.
Themes can be obtained from in
If a plot.file is given, the ggplot arising from this function is saved as an "RDS" binary file using saveRDS(); can be reloaded with readRDS(). A file name must be specified for the plot to be saved. If a plot directory (plot.dir) is specified, the ggplot binary is saved to that directory; otherwise to the tempdir().
Value
The unchanged genlight object
Author(s)
Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr
See Also
Other matched reports:
gl.mahal.assign()
,
gl.report.bases()
,
gl.report.fstat()
,
gl.report.monomorphs()
Examples
pca <- gl.pcoa(testset.gl)
gl.report.factorloadings(pca = pca)