stop("shape of 'skeleton' is not compatible with 'NROW(flesh)'")
stop("don't know how to split or relist a ", class(flesh),
listData <- lapply(skeleton, function(i) extractROWS(flesh, i))
.splitAsList_by_integer <- function(x, f, drop)
stop("'f' cannot be longer than 'NROW(x)' when it's an integer vector")
warning("'drop' is ignored when 'f' is an integer vector")
.splitAsList_by_factor <- function(x, f, drop)
.splitAsList_by_integer_Rle <- function(x, f, drop)
stop("'f' cannot be longer than data when it's an integer-Rle")
warning("'drop' is ignored when 'f' is an integer-Rle")
.splitAsList_by_Rle <- function(x, f, drop)
f <- tabulate2(f_vals, nbins=length(f_levels), weight=f_lens)
splitAsList <- function(x, f, drop=FALSE)
if (!((is.vector(f) && is.atomic(f)) || is.factor(f) || is(f, "Rle")))
stop("'f' must be an atomic vector or a factor (possibly in Rle form)")
stop("'length(f)' is 0 but 'NROW(x)' is > 0")
warning("'NROW(x)' is not a multiple of 'length(f)'")
if (!((is.vector(f_vals) && is.atomic(f_vals)) || is.factor(f_vals)))
function(x, f, drop=FALSE) splitAsList(x, f, drop=drop)
function(x, f, drop=FALSE, ...) split(x, as.vector(f), drop=drop, ...)
unlisted_i <- unlist(i, recursive=FALSE, use.names=FALSE)

"length of 'value' must not be greater than that of 'filters'"
"number of filters not a multiple of 'value' length"
## takes logical expressions, character vectors, or functions to parse
"'active' must be logical without any missing values"
"length of 'active' is greater than number of rules"
"number of rules must be a multiple of length of 'active'"
"length of 'active' must match length of 'filters'"
"names of 'active' must match those of 'filters'"
"function rule must take at least one parameter"
"filter rule evaluated to non-logical: "
"filter rule evaluated to inconsistent length: "
### FilterMatrix: coordinates results from multiple filters
"cannot rbind filter matrices with non-identical rule sets"
"if names(filterRules) and colnames(matrix) are both not NULL,"

setReplaceMethod("active", "FilterRules", function(x, value) {
if (any(value < 1) || any(value > length(x)))
value <- value[!is.na(value)] ## NA's are dropped
stop("'value' contains invalid filter names")
stop("length of 'value' must not be greater than that of 'filters'")
if (nfilters && (nfilters %% length(value) != 0))
stop("number of filters not a multiple of 'value' length")
x@active <- rep(value, length.out = nfilters)
} else stop("unsupported type of 'value'")
expr <- try(parse(text = expr, srcfile = NULL), silent = TRUE)
stop("failed to parse filter expression: ", expr)
} else if (is.language(expr) || is.logical(expr))
else stop("would not evaluate to logical: ", expr)
FilterRules <- function(exprs = list(), ..., active = TRUE) {
active <- rep(active, length.out = length(exprs))
stop("'active' must be logical without any missing values")
stop("length of 'active' is greater than number of rules")
if (length(exprs) && length(exprs) %% length(active) > 0)
stop("number of rules must be a multiple of length of 'active'")
ans <- newList("FilterRules", exprs, active = active)
active <- x@active ## in case we expanded
names(x) <- make.names(names(x), unique = TRUE)
x@active <- setNames(setNames(x@active, names(x))[i], NULL)
if (is.function(rule) && length(formals(rule)) < 1)
stop("\"c\" method for FilterRules objects ",
structure(unlist(lapply(args, active), use.names = FALSE),
mcols(ans) <- do.call(rbind, lapply(args, mcols))
enclos = if(is.list(envir) || is.pairlist(envir))
stop("filter rule evaluated to non-logical: ",
if ((NROW(envir) == 0L && length(val) > 0L) ||
(NROW(envir) > 0L && length(val) == 0L) ||
stop("filter rule evaluated to inconsistent length: ",
m <- do.call(cbind, lapply(inds, function(i) {
result <- eval(expr[i], envir = envir, enclos = enclos)
FilterMatrix(matrix = m, filterRules = expr)
setMethod("subsetByFilter", c("ANY", "FilterRules"), function(x, filter) {
function(object, subject, serial = FALSE, discarded = FALSE,
mat <- evalSeparately(object, subject, serial = serial)
summary(mat, discarded = discarded, percent = percent)
paste(names(p), "=", sapply(p, deparse, control = NULL),
setMethod("[", "FilterMatrix", function(x, i, j, ..., drop = TRUE) {
ans <- FilterMatrix(matrix = ans, filterRules = filterRules)
setMethod("rbind", "FilterMatrix", function(..., deparse.level = 1) {
stop("cannot rbind filter matrices with non-identical rule sets")
FilterMatrix(matrix = ans, filterRules = rulesList[[1]])
setMethod("cbind", "FilterMatrix", function(..., deparse.level = 1) {
rules <- do.call(c, lapply(list(...), function(x) x@filterRules))
FilterMatrix(matrix = ans, filterRules = rules)
FilterMatrix <- function(matrix, filterRules) {
stop("if names(filterRules) and colnames(matrix) are both not NULL,",
new("FilterMatrix", matrix, filterRules = filterRules)
cat(class(object), " (", nrow(object), " x ", ncol(object), ")\n", sep = "")
mat <- makePrettyMatrixForCompactPrinting(object, function(x) x@.Data)
function(object, discarded = FALSE, percent = FALSE)
stop("'discarded' must be TRUE or FALSE")
counts <- c("<initial>" = nrow(object), colSums(object),
"<final>" = sum(rowSums(object) == ncol(object)))