# 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)
# now perform the scaling test
dfm_scaling_test(scaling_results,
labels = preprocessed_documents$labels)
# }
Run the code above in your browser using DataLab