Plots the scatter of two components of a sPLS-DA, as generated by perform.sPLSDA.
plot.sPLSDA.scatter(
DEprot.sPLSDA.object,
comp.x = 1,
comp.y = 2,
color.column = NULL,
shape.column = NULL,
label.column = NULL,
ellipse = TRUE,
ellipse.level = 0.95,
plot.zero.line.x = TRUE,
plot.zero.line.y = TRUE,
point.size = 3
)An object of class DEprot.sPLSDA.
Number indicating which component to display on the x-axis. Default: 1.
Number indicating which component to display on the y-axis. Default: 2.
String indicating the name of the column in the metadata to use as factor for the dot colors. Default: NULL (the column used to fit the model).
String indicating the name of the column in the metadata to use as factor for the dot shapes. Default: NULL (all dots).
String indicating the name of the column in the metadata to use as label of the dots. Default: NULL (no labeling).
Logical value indicating whether a confidence ellipse should be drawn around each group of the color.column. Default: TRUE.
Numeric value (0-1) indicating the confidence level of the ellipses. Default: 0.95.
Logical value to indicate whether to plot a gray dashed line in correspondence of x=0. Default: TRUE.
Logical value to indicate whether to plot a gray dashed line in correspondence of y=0. Default: TRUE.
Numeric value indicating the size of the dots. Default: 3.
A ggplot object.
The ellipses are a reading aid, not a test: a supervised model is fitted to separate the classes, so on the training samples the groups will look tidy even when the cross-validated error rate is poor. The error rates stored in the performance slot are what says whether the separation holds (plot.sPLSDA.performance).
splsda <- perform.sPLSDA(DEprot.object = DEprot::test.toolbox$dpo.imp,
group.column = "condition",
keepX = 5,
validate = FALSE)
#> Warning: The number of 'folds' (5) is larger than the smallest class (4 samples): 'folds' has been set to 4.
plot.sPLSDA.scatter(DEprot.sPLSDA.object = splsda,
comp.x = 1,
comp.y = 2,
shape.column = "replicate")
#> Warning: The following aesthetics were dropped during statistical transformation: shape.
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#> the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#> variable into a factor?