### DataTable is an API only (i.e. virtual class with no slots) for accessing
### objects with a rectangular shape like DataFrame or RangedData objects.
### It mimics the API for standard data.frame objects.
### See the Vector-class.R file for the definitions of the DataTable and
### DataTableORNULL virtual classes (they need to occur before the definition
"missing 'cbind' method for DataTable class "
"missing 'rbind' method for DataTable class "
## FIXME: do not cheat by going through data.frame
### FIXME: this is not the same signature/contract as for data.frame
"'start', 'end', and 'width' arguments have unequal length"
### S3/S4 combo for duplicated.DataTable

setMethod("dim", "DataTable", function(x) c(nrow(x), ncol(x)))
function(x, subset, select, drop = FALSE, ...)
i <- eval(substitute(subset), x, parent.frame(2))
stop("'subset' must be coercible to logical")
j <- eval(substitute(select), nl, parent.frame(2))
na <- do.call(cbind, lapply(seq(ncol(x)), function(xi) is.na(x[[xi]])))
} else complete.cases(args[[1L]]) & do.call(complete.cases, args[-1L])
stop("missing 'cbind' method for DataTable class ",
stop("missing 'rbind' method for DataTable class ",
setMethod("merge", c("DataTable", "DataTable"), function(x, y, ...) {
DataFrame(merge(as(x, "data.frame"), as(y, "data.frame"), ...))
setMethod("merge", c("data.frame", "DataTable"), function(x, y, ...) {
setMethod("merge", c("DataTable", "data.frame"), function(x, y, ...) {
stop("'start', 'end', and 'width' arguments have unequal length")
indices <- structure(seq_len(n), names = names(start))
indices <- structure(seq_len(n), names = names(end))
if (is.null(frequency) && is.null(delta)) {
FUN(window(x, start = start[i], end = end[i]), ...),
frequency <- rep(frequency, length.out = n)
FUN(window(x, start = start[i], end = end[i],
frequency = frequency[i], delta = delta[i]),
.by.data.frame <- by.data.frame # so it will find our generic
function(data, INDICES, FUN, ..., simplify = TRUE)
duplicated.DataTable <- function(x, incomparables=FALSE, fromLast=FALSE, ...)
nr, ifelse(nr == 1, " row and ", " rows and "),
nc, ifelse(nc == 1, " column\n", " columns\n"),
rownames(out) <- .rownames(nms, nr, nhead, ntail)
.rownames <- function(nms, nrow, nhead, ntail)