all_factor: Convert all variables to factors.

Description Usage Arguments Value Examples

Description

This convenience function converts all columns of the supplied data frame into a factors. Existing factors can be ignored (default) or set again which would result in losing any special order or labels.

Usage

1
all_factor(dt, refactor = FALSE, ord = FALSE)

Arguments

dt

A data frame.

refactor

A logical scalar value. Do you want it to also work on variables that are already factors? Default = FALSE.

ord

A logical vector, indicating which columns of dt should be converted to ordered factors. Will be recycled as necessary.

Value

A copy of the input where all variables except logicals have been converted to factors.

Examples

1
str(all_factor(data.frame(x = c("foo", "bar"), y = c(10, 20))))

julianhatwell/arulesimp documentation built on May 11, 2019, 4:17 p.m.