XDataFrame-utils {IRanges}R Documentation

XDataFrame utility functions

Description

Utility functions for manipulating XDataFrame objects.

Usage

## S4 method for signature 'expressionORlanguage,
##   XDataFrame':
eval(expr, envir, enclos = parent.frame())

Arguments

expr The expression, call, or name to be evaluated.
envir The XDataFrame object in which to evaluate expr.
enclos The environment in which to look for symbols that do not exist in the environment formed from XDataFrame.

Details

The eval method converts the XDataFrame object specified in envir to an environmnent, with enclos as its parent, and then evaluates expr within that environment. As when evaluating within an ordinary data.frame, the environment formed from an XDataFrame contains a symbol for each column name which refers to the object stored in that column.

The objects are not actually copied into the environment. Rather, they are dynamically bound using makeActiveBinding. This prevents unnecessary copying of the data from the external vectors into R vectors. The values are cached, so that the data is not copied every time the symbol is accessed.

Value

The result of expression evaluation.

Author(s)

Michael Lawrence

See Also

FilterRules objects, which can be evaluated on a XDataFrame, and the base eval function.

Examples

  score <- c(10L, 2L, NA)
  rd <- XDataFrame(score)
  evalq(score > 3, rd)

[Package IRanges version 1.0.16 Index]