get_cluster_fill_rates: Get Cluster Fill Rates

View source: R/cluster_profiles.R

get_cluster_fill_ratesR Documentation

Get Cluster Fill Rates

Description

get_cluster_fill_rates() creates a data frame that shows the proportion of graphs assigned to each cluster in a cluster template.

Usage

get_cluster_fill_rates(df)

Arguments

df

A data frame of cluster assignments from get_clusters_batch. The data frame has columns docname and cluster. Each row corresponds to a graph and lists the document from which the graph was obtained and the cluster to which that graph is assigned. Optionally, the data frame might also have writer and doc columns. If present, writer lists the writer ID of each document and doc is an identifier to distinguish between different documents from the same writer.

Value

A data frame of cluster fill rates.

Examples

docname <- c(rep("doc1", 20), rep("doc2", 20), rep("doc3", 20))
writer <- c(rep(1, 20), rep(2, 20), rep(3, 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)
rates <- get_cluster_fill_rates(df)


CSAFE-ISU/handwriter documentation built on Feb. 8, 2025, 6:25 a.m.