Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

expand.ffgrid

Create a ffdf from All Combinations of Factors


Description

Similar as expand.grid in the base package generates an ffdf. Code is almost copy-pasted from expand.grid.

Usage

expand.ffgrid(..., KEEP.OUT.ATTRS = TRUE, stringsAsFactors = TRUE)

Arguments

...

ff vectors, ff factors or a list containing these.

KEEP.OUT.ATTRS

currently ignored

stringsAsFactors

logical specifying if character vectors are converted to factors. Irrelevant for ff as character vectors are factors in package ff.

Value

A ffdf containing one row for each combination of the supplied factors. The first factors vary fastest. The columns are labelled by the factors if these are supplied as named arguments or named components of a list.

See Also

Examples

comb <- expand.ffgrid(ff(1:1000), ff(factor(LETTERS)))
dim(comb)

x <- ff(factor(LETTERS))
y <- ff(1:1000)
z <- ff(seq.Date(Sys.Date(), Sys.Date()+10, by = "day"))
comb <- expand.ffgrid(x, y, z)
dim(comb)
comb[1:100, ]

expand.ffgrid(list(a = ff(1:10), b = ff(1:10)))

ffbase

Basic Statistical Functions for Package 'ff'

v0.13.3
GPL-3
Authors
Edwin de Jonge, Jan Wijffels, Jan van der Laan
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.