Description Usage Arguments Value See Also Examples
Merge clusters, categories, and the original data back together.
1 | categorize(data, assign.cluster, cluster.key)
|
data |
A data set that was fit with a cluster model. |
assign.cluster |
An |
cluster.key |
An |
Returns a data.frame
key of clusters and categories.
write_cluster_text
,
read_cluster_text
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(dplyr)
## Assign Clusters
ca <- presidential_debates_2012 %>%
with(data_store(dialogue)) %>%
hierarchical_cluster() %>%
assign_cluster(k = 7)
## Write Cluster Text for Human Categorization
write_cluster_text(ca)
write_cluster_text(ca, n.sample=10)
write_cluster_text(ca, lead=" -", n.sample=10)
## Read Human Coded Categories Back In
categories_file <- system.file("additional/foo_turk.txt", package = "clustext")
readLines(categories_file)
(categories_key <- read_cluster_text(categories_file))
## Add Categories Back to Original Data Set
categorize(
data = presidential_debates_2012,
assign.cluster = ca,
cluster.key = categories_key
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.