Description Usage Arguments Value Examples
Plot Procrustes transformed scaled positions of each document under each preprocessing regime.
1 2 | document_position_plots(positions_list, num_cols = 10, colors = NULL,
decision_colors = NULL)
|
positions_list |
A list of scaled document positions generated by the 'scaling_comparison()' and returned in the '$scaled_positions' field. |
num_cols |
The number of columns to use in combining plots into a a large tiled plot.. |
colors |
Optional vector of document colors to distinguish groups. |
decision_colors |
Defaults to NULL, if desired, the user should provide a vector of logical values of length equal to the number of preprocessing decisions. Can be used to bifurcate the points within a single plot to show the effects of a particular decision. Points in the TRUE class will be colors BLUE and those in the FALSE class will be colored red. |
A list of ggplot2 objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
# *** This function is used automatically inside of the preText() function.
# 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)
# scale documents
scaling_results <- scaling_comparison(preprocessed_documents$dfm_list,
dimensions = 2,
distance_method = "cosine",
verbose = TRUE)
# plot scaled positions
document_position_plots(scaling_results$scaled_positions,
num_cols = 10,
colors = NULL,
decision_colors = NULL)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.