Skip to contents

Checks a list of annotations for those that are overlapping in the time or frequency domain, and returns a list where overlapping annotations are merged. Annotation objects must have the same file, type and value to be merged, where NA is the same as NA and nothing else.

Usage

merge_annotations(
  annotations,
  domain = "time",
  same.source = TRUE,
  same.identifiedBy = TRUE
)

Arguments

annotations

A list of Annotation objects, or a single one.

domain

Domain of the annotations, either "time" or "frequency".

same.source

If TRUE, annotations must have the same source to be merged.

same.identifiedBy

If TRUE, annotations must have been made by the same person or software, their identifiedBy, to be merged. Merging the annotations of several people into one credits only one of them.

Value

A list of Annotation objects.

Details

The merged annotation spans all of those merged into it, in both domains. It keeps the source, identifiedBy, dateIdentified and metadata of the last of them in the order sort_annotations() puts them in.