Plot PLS-DA loadings and also set up the matrix for display
Source:R/metabolomics_plots.R
met.plot_PLS2DLoading.Rd
met.plot_PLS2DLoading
visualizes which features are responsible for the patterns seen among the samples in partial least squares-discriminant analysis.
Usage
met.plot_PLS2DLoading(
mSetObj = NA,
imgName = "PLSDA_2DLoadings",
format = "pdf",
dpi = NULL,
subtitle = FALSE,
width = NA,
inx1 = 1,
inx2 = 2,
plot = TRUE,
export = TRUE
)
Arguments
- mSetObj
Input name of the created mSet object, Data container after partial least squares-discriminant analysis (
met.PLSR.Anal
andmet.PLSDA.CV
).- imgName
(Character) Enter a name for the image file (if
export = TRUE
).- format
(Character,
"png"
or"pdf"
) image file format (ifexport = TRUE
).- dpi
(Numeric) resolution of the image file (if
export = TRUE
). IfNULL
, the resolution will be chosen automatically based on the chosen file format (300 dpi for PNG, 72 dpi for PDF)- subtitle
(Logical,
TRUE
orFALSE
) Shall the applied data transformation and scaling methods be displayed below the plot title?- width
(Numeric) width of the the image file in inches (if
export = TRUE
).- inx1
Numeric, indicate the number of the principal component for the x-axis of the loading plot.
- inx2
Numeric, indicate the number of the principal component for the y-axis of the loading plot.
- plot
(Logical,
TRUE
orFALSE
) Shall the plot be returned in the RStudio 'Plots' pane?- export
(Logical,
TRUE
orFALSE
) Shall the plot be exported as PDF or PNG file?
Value
The input mSet object with added scatter plot. The plot can be retrieved from within R via print(mSetObj$imgSet$pls.loading_PCx_PCy.plot)
.
References
adapted from PlotPLSLoading
(https://github.com/xia-lab/MetaboAnalystR).
Author
Nicolas T. Wirth mail.nicowirth@gmail.com Technical University of Denmark License: GNU GPL (>= 2)