preText_score_plot: preText specification plot

Description Usage Arguments Value Examples

View source: R/preText_score_plot.R

Description

preText plots for each preprocessing specification.

Usage

1
2
3
4
5
6
7
preText_score_plot(
  preText_results,
  display_raw_rankings = FALSE,
  remove_labels = FALSE,
  num_docs = NULL,
  text_size = 1
)

Arguments

preText_results

The output from the 'preText_test()' or 'preText()' functions.

display_raw_rankings

Logical indicating whether raw ranking differences should be displayed (as opposed to relative differences).

remove_labels

Option to remove preprocessing step labels. Defaults to FALSE.

num_docs

If display_raw_rankings = TRUE, the number of documents in the corpus.

text_size

The 'cex' for text in dot plot generated by function. Defaults to 1.

Value

A plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# load the package
library(preText)
# load in the data
data("UK_Manifestos")
# preprocess data
preprocessed_documents <- factorial_preprocessing(
    UK_Manifestos,
    use_ngrams = TRUE,
    infrequent_term_threshold = 0.02,
    verbose = TRUE)
# run preText
preText_results <- preText(
    preprocessed_documents,
    dataset_name = "Inaugural Speeches",
    distance_method = "cosine",
    num_comparisons = 100,
    verbose = TRUE)
# generate preText score plot
preText_score_plot(preText_results)

## End(Not run)

matthewjdenny/preText documentation built on July 27, 2021, 1:18 a.m.