set_factors: Set a vector to a factor

View source: R/utils.R

set_factorsR Documentation

Set a vector to a factor

Description

Set a vector to a factor

Usage

set_factors(x, rev = FALSE, sort = FALSE)

Arguments

x

a vector.

rev

if TRUE, reverse the factor level.

sort

if TRUE, sort the vector before setting factor.

Examples

set_factors(c("B", "B", "A", "C"))
set_factors(c("B", "B", "A", "C"), rev = TRUE)
set_factors(c("B", "B", "A", "C"), sort = TRUE)

hiplot/hiplotlib documentation built on Jan. 31, 2024, 10:11 a.m.