This function sets up a context using the provided data (typically an ENA matrix),
allowing the evaluation of an expression (`expr`) with access to both the matrix and
its metadata. Optionally, a custom matrix `V` and other arguments can be supplied.
Usage
# S3 method for class 'ena.matrix'
with(data, expr, ...)
Arguments
- data
An ENA matrix or data frame containing the data to be used.
- expr
An R expression to be evaluated within the context of the ENA matrix.
- ...
Additional arguments, including an optional custom matrix `V` and other parameters.
Value
The result of evaluating `expr` in the constructed context.
Details
- If a custom matrix `V` is provided in `...`, it will be used; otherwise, `data` is converted to a matrix.
- Metadata columns are coerced to numeric if they are character vectors.
- The expression is evaluated with access to both the matrix (`V`) and metadata.