% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{aggregate_by_entity}
\alias{aggregate_by_entity}
\title{Aggregate multi-valued fields by an entity}
\usage{
aggregate_by_entity(data, entity_field, value_field, min_freq = 1L)
}
\arguments{
\item{data}{A data frame with \code{id} and the specified columns.}

\item{entity_field}{Character. Name of the entity column. If it is a scalar
column (e.g., \code{"journal"}), each document belongs to one entity. If it
is a list-column (e.g., \code{"authors"}), each document may belong to
multiple entities.}

\item{value_field}{Character. Name of the list-column to aggregate
(e.g., \code{"references"}).}

\item{min_freq}{Integer. Minimum number of papers per entity. Default 1.}
}
\value{
A data frame with columns \code{id} (entity name) and \code{value_field}
(list-column of pooled values, with duplicates preserved).
}
\description{
Groups documents by a single-valued or list-column entity (e.g., author,
journal) and pools all values from another list-column (e.g., references,
keywords) across documents belonging to that entity.
}
\keyword{internal}
