% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utility_functions.R
\name{get_by_partition}
\alias{get_by_partition}
\title{Aggregate data frame by partitions}
\usage{
get_by_partition(
  df,
  partitioning,
  FUN,
  columns = NULL,
  simplify = TRUE,
  drop = TRUE,
  BPPARAM = BiocParallel::SerialParam()
)
}
\arguments{
\item{df}{Data frame that shall be aggregated.}

\item{partitioning}{Nested list, specifying which \code{df} rows belong to one partition.}

\item{FUN}{Aggregation function. Can be a base function like \code{unique}, \code{length}, etc., or a custom function.}

\item{columns}{Optional: Only aggregate the specified columns of \code{df}. Defaults to all columns.}

\item{simplify}{a logical indicating whether results should be
    simplified to a vector or matrix if possible.}

\item{drop}{a logical indicating whether to drop unused combinations
    of grouping values.  The non-default case \code{drop=FALSE} has been
    amended for \R 3.5.0 to drop unused combinations.}

\item{BPPARAM}{If multicore processing should be used, specify a \code{BiocParallelParam} object here. Among others, can be \code{SerialParam()} (default) for standard non-multicore processing or \code{MulticoreParam('number_cores')} for multicore processing. See \code{\link[BiocParallel:BiocParallel-package]{BiocParallel}} for more information.}
}
\value{
Data frame with Group column that specifies the partition and one column per specified column with aggregated values.
}
\description{
Convenience function to aggregate the data frame according to the partitioning.
Can specify a aggregation function like in \code{\link[stats:aggregate.data.frame]{aggregate}}.
}
