Description Usage Arguments Details Examples
Compare wrapper function
1 2 |
clustering_solution |
The output from the |
compare_which |
A factor variable of the groups of interest for comparison. |
which_clusters |
Clusters to be included in the comparison. Default is all clusters. |
which_groups |
Levels of the grouping factor to be included in the comparison. Default is all levels. |
Function for comparing clustering solution between subgroups. Output is contingency table for the specified groups and clusters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(clustRcompaR)
library(dplyr)
library(quanteda)
d <- inaugural_addresses
d <- mutate(d, century = ifelse(Year < 1800, "17th",
ifelse(Year >= 1800 & Year < 1900, "18th",
ifelse(Year >= 1900 & Year < 2000, "19th", "20th"))))
three_clusters <- cluster(d, century, n_clusters = 3)
extract_terms(three_clusters)
three_clusters_comparison <- compare(three_clusters, "century")
compare_plot(three_clusters_comparison)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.