View source: R/PrettyBarPlot2.R
PrettyBarPlot2 | R Documentation |
ggplot2
-based
function to plot bar plots
for a series
of variables:
Used for plotting bootstrap ratios
or contributions for
PCA, CA, MCA, PLS, etc.PrettyBarPlot2
:
a ggplot2
-based version of
PrettybarPlot
and
PrettyBarPlotColor
.
PrettyBarPlot2
creates bar plots for a set of items
(e.g., observations or variables) analyzed
with multivariate methods
such as PCA, CA, MCA, PLS etc.
PrettyBarPlot2
is used to display the bootstrap ratios
or contributions plots for CA/MCA/PCA/PLS.
Significant or important items are plotted
in color, non-significant (or un-important)
items are plotted in gray.
PrettyBarPlot2( bootratio, font.size = NULL, threshold = 3, ylim = NULL, color.bar = c("lavender", "darkolivegreen3", "gray90"), color.bord = c("mediumpurple4", "darkolivegreen4", "gray75"), color.letter = c("mediumpurple4", "darkolivegreen4", "gray75"), color4ns = "gray75", color4bar = NULL, plotnames = TRUE, main = NULL, ylab = NULL, sortValues = FALSE, signifOnly = FALSE, horizontal = TRUE, angle.text = if (horizontal) { 90 } else { 0 }, abbreviate_labels = FALSE, make_labels_into_paragraphs = FALSE, font.shrink = 1, line.col = "red", line.type = 2, line.size = 0.5, line.alpha = 0.5 )
bootratio |
the bootstrap ratios
(BR) or contributions
or similar statistics to be plotted.
(e.g., obtained from |
font.size |
(Default: |
threshold |
(Default: |
ylim |
(Default: |
color.bar |
a 3-element vector
of color names for the bars for (respectively)
significant positive,
significant negative, and non-significant.
Default is
|
color.bord |
The color for the border of the bars,
Default:
|
color.letter |
a 3-element vector of color names
for the names of
the items for (respectively)
significant positive, significant negative,
and non-significant.
Default is
|
color4ns |
(Default: |
color4bar |
(Default: |
plotnames |
if codeTRUE (default) write the names of the items. |
main |
(default is |
ylab |
(default is |
sortValues |
(Default: |
signifOnly |
(Default: |
horizontal |
(Default: |
angle.text |
(Default: |
abbreviate_labels |
(Default: |
make_labels_into_paragraphs |
(Default: |
font.shrink |
( |
line.col |
( |
line.type |
The type of line for the critical line
( |
line.size |
( |
line.alpha |
( |
Note that this version
is still in
development. Current version generates
a (strange) warning message
from ggplot2
about element_text()
.
PrettyBarPlot2
integrates PrettyBarPlot
and PrettyBarPlotColors
.
A ggplot2
object containg the graph
(i.e., to be plotted with print
).
Vincent Guillemot & Hervé Abdi
PrettyBarPlot
PrettyBarPlotColor
PrettyBarPlotColor4Q
toto <- 8*(.5 - runif(7)) names(toto) <- paste0('V', 1:7) PrettyBarPlot2(toto)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.