plot_keywords: Plots keywords from 'scale_text'

Description Usage Arguments See Also Examples

View source: R/plot_keywords.R

Description

plot_keywords plots keywords for each scaled text dimension.

Usage

1
2
3
plot_keywords(scores, x_dimension = 1, y_dimension = 2,
  q_cutoff = 0.9, plot_density = FALSE, unstretch = FALSE,
  color = FALSE)

Arguments

scores

List from output of scale_text.

x_dimension

An integer scalar. Dimension for x axis.

y_dimension

An integer scalar. Dimension for y axis.

q_cutoff

A numeric (0-1) scalar. Proportion of words to plot. For example, setting q_cutoff=0.9 will plot the most common 10% of words.

plot_density

A logical scalar. Plot both biplot and density.

unstretch

A logical scalar. Move pivot words toward origin.

color

A logical scalar. Color words in plot. If vector color is not provided in scores, will assign 5 colors using k-means on dimensions 1 through 10.

See Also

scale_text, read_word_embeddings, get_keywords, score_documents, doc_to_tdm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
scores <- scale_text(
    meta=out$meta,
    tdm=tdm
    )

plot_keywords(
    scores, x_dimension=1, y_dimension=2, q_cutoff=0.9
    )

## End(Not run)

wilryh/parrot documentation built on Jan. 9, 2020, 2:16 p.m.