Creation and manipulation of span objects.
1 2 3
integer vectors giving the start and end positions of the spans.
an R object.
A single span is a pair with “slots” ‘start’ and ‘end’, giving the start and end positions of the span.
Span objects provide sequences (allowing positional access) of single
spans. They have class
"Span". Span objects can be coerced to
annotation objects via
as.Annotation() (which of course is
only appropriate provided that the spans are character spans of the
natural language text being annotated), and annotation objects can be
coerced to span objects via
as.Span() (giving the character spans
of the annotations).
Subscripting span objects via
[ extracts subsets of spans;
$ extracts integer vectors with the sequence
of values of the named slot.
There are several additional methods for class
c() combines spans (or objects coercible to these using
as.data.frame() coerce, respectively, to
lists (of single span objects) and data frames (with spans and slots
corresponding to rows and columns). Finally, one can add a scalar and
a span object (resulting in shifting the start and end positions by
Span() creates span objects from the given sequences of start
and end positions, which must have the same length.
as.Span() coerces to span objects, with a method for annotation
is.Span() tests whether an object inherits from class
"Span" (and hence returns
TRUE for both span and
as.Span(), a span object (of class
is.Span(), a logical.