R: Evaluate an expression in a ffdf data environment

with.ffdf {ffbase} | R Documentation

## Evaluate an expression in a ffdf data environment

### Description

Evaluate an R expression in an environment constructed from a ffdf data frame. (see `with`). Please note that you should write your expression as if it is a normal `data.frame`. The resulting return value however will be a `ff` object.

### Usage

    ## S3 method for class 'ffdf'
    with(data, expr, ...)

### Arguments

`data` | `ffdf` data object used as an environment for evaluation.
`expr` | expression to evaluate.
`...` | arguments to be passed to `chunk`.

### Value

if expression is a `vector` a newly created `ff` vector will be returned otherwise if the expression is a data.frame a newly created `ffdf` object will be returned.

### Note

'with.ffdf' assumes that the returned object is of equal length as 'nrow(data)' and must be converted to a 'ff' object In case this is not true, the result won't be correct.

### See Also

`ffdfwith`

### Examples

    dat <- data.frame(x=1:10, y=10:1)

    ffdat <- as.ffdf(dat)

    with(ffdat, {x+y})

[Package ffbase version 0.13.1 Index]