Learn R Programming

LabApplStat (version 1.4.4)

minimum: Minimum between factors

Description

minimum finds the minimum of two factors, i.e. the finest factors that is coarser than both of the factors.

Usage

minimum(x, y, concatenate.names = TRUE)

Value

A factor with the minimum.

Arguments

x

vector that will be interpreted as a factor.

y

vector that will be interpreted as a factor.

concatenate.names

boolean. If TRUE then the levels of the minimum are constructed as the concatenation of the levels for x and y. If FALSE then the levels of the minimum are given as numbers. Defaults to TRUE.

Author

Bo Markussen

Examples

Run this code
x <- rep(c("boy","girl","adult","adult"),4)
y <- rep(c("child","child","man","woman"),4)
minimum(x,y)
minimum(x,y,FALSE)

Run the code above in your browser using DataLab