Learn R Programming

mosaic (version 0.4-1)

logical2factor: Turn logicals into factors; leave other things alone

Description

Turn logicals into factors; leave other things alone

Usage

logical2factor(x, ...)

## S3 method for class 'default': logical2factor(x, ...)

## S3 method for class 'data.frame': logical2factor(x, ...)

Arguments

x
a vector or data frame
...
additional arguments (currently ignored)

Value

  • If x is a vector either x or the result of converting x into a factor with levels TRUE and FALSE (in that order); if x is a data frame, a data frame with all logicals converted to factors in this manner.