isConstant((x - 11/3) * 1e8)  # FALSE on Intel Pentium paltforms

### Aliases: class:List List-class List elementType elementType,List-method
###   isEmpty,List-method show,List-method [[,List-method [[<-,List-method
###   $,List-method $<-,List-method [,List-method [<-,List-method
###   as.env,List-method unlist,List-method stack,List-method eval

showClass("List")  # shows (some of) the known subclasses

### Aliases: class:MaskCollection MaskCollection-class MaskCollection
###   names<-,MaskCollection-method desc desc,MaskCollection-method desc<-

names(mymasks) <- c("A", "B", "C")  # names should be short and unique...
mymasks[c("C", "A")]  # ...to make subsetting by names easier
desc(mymasks) <- c("you can be", "more verbose", "here")
active(mymasks) <- FALSE  # deactivate all masks
active(mymasks)[-1] <- TRUE  # reactivate all masks except mask 1
active(mymasks) <- !active(mymasks)  # toggle all masks

### Title: Split elements belonging to multiple groups

### Title: Finding the nearest range neighbor
### Aliases: nearest-methods class:RangesORmissing RangesORmissing-class
###   RangesORmissing nearest precede follow distance distanceToNearest

precede(query, subject)     # c(3L, 3L, NA)
precede(query, IRanges())   # rep(NA_integer_, 3)
precede(query)              # c(3L, 3L, NA)
follow(query, subject)      # c(NA, NA, 1L)
follow(query, IRanges())    # rep(NA_integer_, 3)
follow(query)               # c(NA, NA, 2L)
sapply(-3:3, function(i) distance(shift(IRanges(4,3), i), IRanges(4,3)))

### Aliases: class:RangedData RangedData-class nrow,RangedData-method

rd <- RangedData(ranges, filter, vals = score)
rd[["vals"]] # same as rd[["score"]] above
rd[["score...score"]] # names made valid
rd <- RangedData(ranges, universe = "hg18")
chrom <- paste("chr", rep(c(1,2), c(length(ranges), length(range2))), sep="")
rd <- RangedData(both, score, filter, space = chrom, universe = "hg18")
rd[1][["score"]] # identical to score[1:3]
rd[numeric()] # these three are all empty
rd <- RangedData(ranges, count, space = c(1, 2, 1))
rd <- RangedData(ranges, score, space = c(1, 2, 1))
unlist(split(rd2, c(1, 2, 1))) # same as 'rd'
lapply(rd, `[[`, 1) # get first column in each space