expand.ffgrid: Create a 'ffdf' from All Combinations of Factors

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
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

expand.grid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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 documentation built on Feb. 27, 2021, 5:06 p.m.