Subset an AnnotationFunction Object

# S3 method for AnnotationFunction
[(x, i)

Arguments

x

An AnnotationFunction-class object.

i

A vector of indices.

Details

One good thing for designing the AnnotationFunction-class is it can be subsetted, and this is the base for the splitting of the annotations.

Examples

anno = anno_simple(1:10) anno[1:5]
#> An AnnotationFunction object #> function: anno_simple() #> position: column #> items: 5 #> width: 1npc #> height: 1*5mm #> imported variable: pt_size, border, value, color_mapping, gp, pt_gp, pch #> subsetable variable: value #> this object is subsetable
draw(anno[1:5], test = "subset of column annotation")