Learn R Programming

AssocBin (version 1.1-0)

stopper: Check bins against stop criteria

Description

Evaluate the stop `criteria` for each bin in `binList`

Usage

stopper(binList, criteria)

Value

A logical vector of the same length as `binList`.

Arguments

binList

a list of bins, each a list which can be cast as an environment for evaluation

criteria

string of logical expressions separated by pipes to be evaluated within each bin of `binList`

Author

Chris Salahub

Details

This function makes use of R's lexical scoping to evaluate `criteria` (a string), within each bin of `binList`.

Examples

Run this code
crits <- makeCriteria(depth >= 5, n < 1)
binList1 <- list(makeBin(x = c(1,2), y = c(3,1), depth = 1, n = 2),
                makeBin(x = c(3,4), y = c(2,4), depth = 1, n = 2))
binList2 <- list(makeBin(x = c(1,2), y = c(3,1), depth = 6, n = 2),
                makeBin(x = c(), y = c(), depth = 1, n = 0))
stopper(binList1, crits)
stopper(binList2, crits)

Run the code above in your browser using DataLab