Learn R Programming

mappings (version 0.2.0)

cf: Construct a factor from one or more vectors

Description

A factor is constructed from one or more atomic vectors. If more than one atomic vector is supplied, then a compound value is constructed by concatenating the values together. The order of the levels is the natural order in which the values appear.

Usage

cf(x, ..., sep = ";")

Value

A factor.

Arguments

x

An atomic vector.

...

Additional atomic vectors (optional).

sep

A character to use as a separator when forming a compound value (default ';').

Examples

Run this code
x <- c("A", "B", "A")
y <- c(2, 5, 7)
cf(x, y)
mapping(cf(x, y), c("X", "Y", "Z"))

Run the code above in your browser using DataLab