met.plot_PLS_Imp
visualizes the features' importance in the PLS-DA model.
Usage
met.plot_PLS_Imp(
mSetObj = NA,
imgName,
format = "pdf",
dpi = NULL,
width = NA,
type = "vip",
feat.nm = c("Comp. 1", "Comp. 2"),
feat.num = 15,
color.BW = FALSE,
plot = TRUE,
export = TRUE,
title = FALSE
)
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
(
"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)- width
(Numeric) width of the the image file in inches (if
export = TRUE
).- type
(Character) Indicate the variables of importance type to use,
"vip"
to use VIP scores, or"coef"
for coefficients- feat.nm
(Character) Indicate the name of the feature. If
type = "vip"
, choose"Comp. 1"
,"Comp. 2"
, etc., depending on the component for which the VIP scores should be shown. Iftype = "coef"
, choose"coef.mean"
for average coefficients, or the name of a sample group in your dataset.- feat.num
(Numeric) Indicate the number of features to show in the plot.
- color.BW
(Logical)
TRUE
to use black and white, orFALSE
to not.- 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?- title
(Logical)
TRUE
to add a title with the used normalization, transformation, and scaling method, orFALSE
to not add any title.
Value
The input mSet object with added dot plot. The plot can be retrieved from within R via print(mSetObj$imgSet$pls.imp_type_feat.nm.plot)
.
References
adapted from PlotPLS.Impg
(https://github.com/xia-lab/MetaboAnalystR).
Author
Nicolas T. Wirth mail.nicowirth@gmail.com Technical University of Denmark License: GNU GPL (>= 2)