Subset an SingleAnnotation Object

# S3 method for SingleAnnotation
[(x, i)

Arguments

x

An SingleAnnotation-class object.

i

A vector of indices.

Details

The SingleAnnotation class object is subsetable only if the containing AnnotationFunction-class object is subsetable. All the anno_* functions are subsetable, so if the SingleAnnotation object is constructed by one of these functions, it is also subsetable.

Examples

ha = SingleAnnotation(value = 1:10) ha[1:5]
#> A single annotation with continuous color mapping #> name: anno1 #> position: column #> show legend: TRUE #> items: 5 #> color is randomly generated #> width: 1npc #> height: 1*5mm #> this object is  subsetable #> 12.7686666666667mm extension on the right
draw(ha[1:5], test = "ha[1:5]")