coverage(x, shift=c(-4, 2))  # 'shift' gets recycled
coverage(x, weight=c(2.8, -10))  # numeric-Rle, 'shift' gets recycled
x <- IRanges(sample(1000, 40, replace=TRUE), width=17:10)
y <- IRanges(sample(-20:280, 36, replace=TRUE), width=28)
coverage(x, width=100) + coverage(y, width=100)))
identical(coverage(c(x, y)), coverage(x) + coverage(y))  # FALSE
x1 <- x[c(TRUE, FALSE)]  # pick up 1st, 3rd, 5th, etc... ranges
x2 <- x[c(FALSE, TRUE)]  # pick up 2nd, 4th, 6th, etc... ranges
stopifnot(identical(coverage(x, width=100), cvg1 + cvg2))
stopifnot(all.equal(coverage(x, weight=-2.68 * weight), -2.68 * cvg3))
times <- sample(0:10L, length(x), replace=TRUE)
stopifnot(sum(cvg3) == sum(width(x) * weight))
dummy.coverage <- function(x, shift=0L, width=NULL)
check_real_vs_dummy <- function(x, shift=0L, width=NULL)
res1 <- coverage(x, shift=shift, width=width)
res2 <- dummy.coverage(x, shift=shift, width=width)
x <- IRangesList(A=IRanges(3*(4:-1), width=1:3), B=IRanges(2:10, width=5))
coverage(x, width=9)  # 'width' gets recycled
cvg2  # 1st coverage vector is an integer-Rle, 2nd is a numeric-Rle

### Aliases: class:DataFrame DataFrame-class nrow,DataFrame-method
## duplicate row, unique row names are created

df <- DataFrame(score, row.names = row.names) #with row names
df <- DataFrame(vals = score) # explicit naming
as.data.frame(sw) # swiss, without row names
sw <- DataFrame(swiss, row.names = rownames(swiss))
sw[,c(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE)]
cn <- paste("X", seq_len(ncol(swiss)), sep = ".")

### Aliases: DataTable-API class:DataTable DataTable-class DataTable

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

### Title: Statistical modeling with DataTable

### Title: Endomorphisms via application of a function over an object's
### Aliases: endoapply endoapply,list-method endoapply,data.frame-method

a <- data.frame(x = 1:10, y = rnorm(10))
b <- data.frame(x = 1:10, y = rnorm(10))
endoapply(a, function(x) (x - mean(x))/sd(x))
mendoapply(function(e1, e2) (e1 - mean(e1)) * (e2 - mean(e2)), a, b)