showClass("Views") # shows (some of) the known subclasses
## Create a set of 4 views on an XInteger subject of length 10:
subject <- Rle(3:-6)
v1 <- Views(subject, start=4:1, end=4:7)
## Extract the 2nd view:
v1[[2]]
## Some views can be "out of limits"
v2 <- Views(subject, start=4:-1, end=6)
trim(v2)
subviews(v2, end=-2)
## See ?`XIntegerViews-class` in the XVector package for more examples.
Run the code above in your browser using DataLab