# Aggregate data frame by partitions

Source: `R/utility_functions.R`
`get_by_partition.Rd`

Convenience function to aggregate the data frame according to the partitioning. Can specify a aggregation function like in `aggregate`.

    get_by_partition(
      df,
      partitioning,
      FUN,
      columns = NULL,
      simplify = TRUE,
      drop = TRUE,
      BPPARAM = BiocParallel::SerialParam()
    )

## Arguments

df | Data frame that shall be aggregated.
partitioning | Nested list, specifying which `df` rows belong to one partition.
FUN | Aggregation function. Can be a base function like `unique`, `length`, etc., or a custom function.
columns | Optional: Only aggregate the specified columns of `df`. Defaults to all columns.
simplify | a logical indicating whether results should be simplified to a vector or matrix if possible.
drop | a logical indicating whether to drop unused combinations of grouping values. The non-default case `drop=FALSE` has been amended for R 3.5.0 to drop unused combinations.
BPPARAM | If multicore processing should be used, specify a `BiocParallelParam` object here. Among others, can be `SerialParam()` (default) for standard non-multicore processing or `MulticoreParam('number_cores')` for multicore processing. See `BiocParallel` for more information.

## Value

Data frame with Group column that specifies the partition and one column per specified column with aggregated values.