summarise_duplicates: Summarise repeated and divergent filesystem observations

View source: R/summarise_duplicates.R

summarise_duplicatesR Documentation

Summarise repeated and divergent filesystem observations

Description

Aggregates observed filesystem observations by filename and lightweight content signatures (quick_sig).

Usage

summarise_duplicates(df)

summarize_duplicates(df)

Arguments

df

A snapshot data.frame conforming to the canonical snapshot schema created by scan_storage() or read_snapshot().

The dataset must contain:

  • filename

  • quick_sig (may contain NA)

Details

The function identifies:

  • repeated identical observations;

  • potentially synchronised copies;

  • diverging versions of similarly named resources;

  • distributed working duplicates.

The function operates on observational filesystem evidence only.

It does not:

  • infer authoritative file identity;

  • establish Record Resource equivalence;

  • reconstruct provenance lineage;

  • determine curatorial relationships.

In RiC-aligned operational terminology:

  • rows in the snapshot represent filesystem observations;

  • repeated identical quick_sig values provide operational evidence that multiple observations may correspond to the same underlying digital resource;

  • differing signatures associated with the same filename may indicate divergent versions, forks, or independently evolving resources.

The function therefore supports:

  • longitudinal reconstruction;

  • distributed workflow analysis;

  • duplicate detection;

  • exploratory Record Set construction;

  • provenance-aware analytical workflows.

Duplicate observations are not inherently anomalous.

In distributed development workflows the same file may legitimately appear:

  • across multiple machines;

  • across synchronised project folders;

  • in backup or staging locations;

  • in derived analytical Record Sets.

The function therefore reports observational duplication rather than asserting erroneous copying.

The function treats:

  • filename as a weak identity signal;

  • quick_sig as a lightweight content equivalence signal.

Missing signatures (NA) are treated as a valid observational group.

This means:

  • multiple NA signatures are considered identical;

  • a mix of NA and non-NA signatures counts as versioning.

The function operates on observational snapshots and does not resolve identity across time or storage contexts.

Value

A data.frame with one row per filename.

The returned variables include:

filename

File basename used as grouping key.

total_copies

Total number of observed filesystem occurrences.

identical_copies

Size of the largest identical-signature group.

versioned_copies

Number of observations outside the largest identical-signature group.

n_versions

Number of distinct observed signatures.

See Also

quick_signature()

Examples

data("fscontextdemo_snapshot_01")
data("fscontextdemo_snapshot_01")

combined_snapshot <- rbind(
  fscontextdemo_snapshot_01,
  fscontextdemo_snapshot_01
)

summarise_duplicates(combined_snapshot)


fscontext documentation built on Nov. 19, 2026, 5:11 p.m.