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

logical2factor

Convert logical vector into factor


Description

Turn logicals into factors with levels ordered with TRUE before FALSE. Other inputs are returned unaltered.

Usage

logical2factor(x, ...)

## Default S3 method:
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.


mosaicCore

Common Utilities for Other MOSAIC-Family Packages

v0.9.0
GPL (>= 2)
Authors
Randall Pruim <rpruim@calvin.edu>, Daniel T. Kaplan <kaplan@macalester.edu>, Nicholas J. Horton <nhorton@amherst.edu>
Initial release

We don't support your browser anymore

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