stylo2gg | R Documentation |
stylo
data with ggplot2
.Visualize stylo
data with ggplot2
.
stylo2gg(
df,
viz,
features,
num.features,
top.loadings,
select.loadings,
pc.x = 1,
pc.y = 2,
title = NULL,
caption = FALSE,
count.labels = FALSE,
legend,
black = NULL,
highlight = NULL,
labeling,
classing,
shapes = FALSE,
invert.x = FALSE,
invert.y = FALSE,
scaling,
distance.measure,
linkage,
horiz = TRUE,
axis.labels = FALSE,
highlight.nudge,
highlight.single,
show.zero,
highlight.box = NULL,
withholding,
loadings.spacer = "_",
loadings.line.color = "lightgray",
loadings.word.color = "darkgray",
loadings.upper = FALSE,
plaintext = TRUE
)
df |
An object saved from running |
viz |
A choice of visualizations, either |
features |
A vector containing a selection of features to consider for analysis. This option is useful for replicating a previous analysis. |
num.features |
The number of features to be used for an
analysis. By default, |
top.loadings |
The number of features to show as
vectors in a principal components analysis. By default,
loadings are not shown unless |
select.loadings |
A list element, with items indicating
either the nearest location of a selected feature or the names
of these features. The location can be shown in three ways: 1.
with coordinates in the PCA space, e.g. |
pc.x |
Identifies the principal component to be placed
on the X-axis. Defaults to |
pc.y |
Identifies the principal component to be placed
on the Y-axis. Defaults to |
title |
The title that will go on the top of a chart.
This value is inherited from |
caption |
Defaults to |
count.labels |
Toggle (TRUE / FALSE) to show or hide counting numbers at the beginning of labels on a dendrogram. Useful for manually setting a |
legend |
Show or hide the legend with |
black |
Cast the color of one category (defined by its number) as black. This setting is ideal to contrast a group for printing in black and white. |
highlight |
Highlight a category (defined by its number) by drawing around its elements on the visualization. In a principal components analysis, multiple circular highlights are available to contrast sets; on a dendrogram, only one category can be highlighted with a box. |
labeling |
Defines how to label items: if setting a
character vector, define one string for each item in
df; if setting a numeric vector (e.g, |
classing |
The class or category for each item in
df; if not set, it defaults to the first element
before an underscore in the filename of items in the
original corpus. |
shapes |
Defaults to |
invert.x |
Defaults to |
invert.y |
Defaults to |
scaling |
Toggle the option to scale features before
running a principal components analysis. Defaults to
|
distance.measure |
The formula used for distance in
hierarchical clustering. Defaults to |
linkage |
The linkage to be used for cluster analysis.
Defaults to |
horiz |
Set the rotation of the dendrogram in a
hierarchical cluster analysis; defaults to |
axis.labels |
Defaults to |
highlight.nudge |
On a highlighted dendrogram, optionally define some extra space when a box overlaps the edge of a label. |
highlight.single |
Toggle (TRUE/FALSE) to determine whether a dendrogram's highlight should draw a single box for all of the items or individual boxes for each cluster. When using |
show.zero |
Toggle (TRUE / FALSE) for leaving space below the lowest distance to indicate zero |
highlight.box |
On a dendrogram, highlight items indicated by their item numbers (from the bottom on a horizontal dendrogram, from the left on a vertical dendrogram); it might be helpful to toggle the |
withholding |
Specify a class or classes of texts to withhold from underlying principal components analysis before these texts are then projected into that space. |
loadings.spacer |
The spacer used to replace spaces in loading words, used for multiple-word n-grams. Define it as a quoted string. Defaults to |
loadings.line.color |
A string defining the lines leading to loading words. Defaults to |
loadings.word.color |
A string defining the color used to display loading words. Defaults to |
loadings.upper |
Toggle (TRUE / FALSE) to convert loadings into uppercase or to leave them alone. The default is FALSE, keeping them unconverted. |
plaintext |
Toggle (TRUE / FALSE) to show text labels as |
Because stylo2gg
builds on ggplot2
, almost all
commands available to that package should work here as well,
using the plus-sign syntax documented by that package.
## Not run:
my_data <- stylo()
my_data %>% stylo2gg()
# Move the legend
my_data %>% stylo2gg() +
theme(legend.position = "bottom")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.