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

cross

Factor cross products


Description

Construct a product of factors.

Usage

cross(..., sep = ":", drop.unused.levels = FALSE)

Arguments

...

factors to be crossed.

sep

separator between levels

drop.unused.levels

should levels that do not appear in cross product be dropped?

Value

a factor

Examples

x <- letters[1:3]
y <- c(1,2,1,1,3,1,3)
cross(x, y)
cross(x, y, drop.unused.levels=TRUE)

mosaic

Project MOSAIC Statistics and Mathematics Teaching Utilities

v1.8.3
GPL (>= 2)
Authors
Randall Pruim [aut, cre], Daniel T. Kaplan [aut], Nicholas J. Horton [aut]
Initial release

We don't support your browser anymore

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