Description Usage Arguments Value Examples
Scale each dfm and return a list of distance matrices and scaled document positions.
1 2 | scaling_comparison(dfm_object_list, dimensions = 2,
distance_method = "cosine", verbose = TRUE, cores = 1)
|
dfm_object_list |
A list of quanteda dfm objects returned in the '$dfm_list$ field of the output from the 'factorial_preprocessing()' function. |
dimensions |
The number of dimensions to be used by the multidimensional scaling algorithm. Defaults to 2. |
distance_method |
The method that should be used for calculating document distances. Defaults to "cosine". |
verbose |
Logical indicating whether more information should be printed to the screen to let the user know about progress. Defaults to TRUE. |
cores |
The number of cores to be used for parallelization (optional). |
A result list object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.