convertToFactor: Convert data to factor representation

Description Usage Arguments Examples

View source: R/misc.R

Description

Convert a matrix, dataframe or vector into a factor representation. Each column is going to be separately converted into a factor.

Usage

1

Arguments

x

the input vector, data.frame or matrix

Examples

1
2
3
4
5
# works on vectors, matrices and data frames
convertToFactor(0)
convertToFactor(c(1, 0, 0, 1, 0))
convertToFactor(matrix(c(1,0), nrow=2, ncol=2))
convertToFactor(data.frame("a"=c(1,0), "b"=c(0,1)))

ddgraph documentation built on Nov. 17, 2017, 10:50 a.m.