---
title: "aggregated(on:naming:transform:)"
framework: tabulardata
role: symbol
role_heading: Instance Method
path: "tabulardata/rowgrouping/aggregated(on:naming:transform:)"
---

# aggregated(on:naming:transform:)

Generates a data frame by aggregating each group’s contents for each column you list by name.

## Declaration

```swift
func aggregated<Element, Result>(on columnNames: [String], naming: (String) -> String, transform: (DiscontiguousColumnSlice<Element>) throws -> Result?) rethrows -> DataFrame
```

## Parameters

- `columnNames`: A comma-separated, or variadic, list of column names.
- `naming`: A closure that converts a column name to another name.
- `transform`: A closure that aggregates a group’s elements in a specific column.

## Discussion

Discussion The data frame contains two columns that: Identify each group Store the results of your aggregation transform closure

## See Also

### Aggregating a Row Grouping

- [counts(order:)](tabulardata/rowgrouping/counts(order:).md)
