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

Expand

Create a Data Frame from All Combinations of Factors


Description

Create a Data Frame from All Combinations of Factors

Usage

Expand(`_data`, ...)

Arguments

_data

Data.frame

...

vectors, factors or a list containing these

Details

Simple wrapper of the 'expand.grid' function. If x is a table then a data frame is returned with one row pr individual observation.

Author(s)

Klaus K. Holst

Examples

dd <- Expand(iris, Sepal.Length=2:8, Species=c("virginica","setosa"))
summary(dd)

T <- with(warpbreaks, table(wool, tension))
Expand(T)

lava

Latent Variable Models

v1.6.10
GPL-3
Authors
Klaus K. Holst [aut, cre], Brice Ozenne [ctb], Thomas Gerds [ctb]
Initial release
2021-09-01

We don't support your browser anymore

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