---
title: "summarize_anomalies"
---

[< Back to Reference](../reference.qmd) | [View source](https://codeberg.org/usrbinr/tidychain/src/branch/main/R/detect_anomalies.R#L194)

# `summarize_anomalies()`

Summarize Detected Anomalies

## Usage

```r
summarize_anomalies(anomalies, xlsx = NULL)
```

## Arguments

| Argument | Description |
|----------|-------------|
| `anomalies` | A tibble of anomalies from `detect_anomalies()`. |
| `xlsx` | Optional xlsx_workbook object for additional context. |

## Value

A list containing:

- `total_anomalies`: Total number of anomalous cells

- `by_sheet`: Count of anomalies per sheet

- `by_type`: Count by anomaly type

- `row_clusters`: Groups of consecutive rows that may have been moved together

- `severity`: Overall severity assessment ("none", "low", "medium", "high")

## Description

Provides summary statistics on detected anomalies, including counts by
sheet, by anomaly type, and identifies clusters of potentially moved rows.

## Examples

```r
## Not run: 
xlsx <- parse_xlsx("spreadsheet.xlsx")
anomalies <- detect_anomalies(xlsx)
summary <- summarize_anomalies(anomalies, xlsx)
print(summary)

## End(Not run)
```

