Learn R Programming

jwutil (version 1.1.1)

factorToDataframeLogical: convert factor into a data.frame of logicals

Description

converts a single factor into a data.frame with multiple T/F fields, one for each factor

Usage

factorToDataframeLogical(fctr, prefix = deparse(substitute(fctr)), sep = "",
  na.rm = TRUE, verbose = FALSE)

Arguments

fctr

factor

prefix

defaults to "f" to pre-pend the factor level when constructing the data frame columns names

sep

scalar character, introduced between factor names and levels when forming new data frame column names

na.rm

logical scalar: if NA data and/or NA levels, then covert to NA strings and expand these as for any other factor

verbose

single logical value, if TRUE then produce verbose messages

Value

data.frame with columns of logicals