Learn R Programming

handwriter (version 3.1.1)

get_cluster_fill_counts: get_cluster_fill_counts

Description

get_cluster_fill_counts() creates a data frame that shows the number of graphs in each cluster for each input document.

Usage

get_cluster_fill_counts(df)

Value

A dataframe of cluster fill counts for each document in the input data frame.

Arguments

df

A data frame with columns writer, doc, and cluster. Each row corresponding to a graph and lists the writer of that graph, the document from which the graph was obtained, and the cluster to which that graph is assigned.

Examples

Run this code
writer <- c(rep(1, 20), rep(2, 20), rep(3, 20))
docname <- c(rep('doc1',20), rep('doc2', 20), rep('doc3', 20))
doc <- c(rep(1, 20), rep(2, 20), rep(3, 20))
cluster <- sample(3, 60, replace=TRUE)
df <- data.frame(docname, writer, doc, cluster)
get_cluster_fill_counts(df)

Run the code above in your browser using DataLab