unfactor: Remove Factor From Object

View source: R/formods.R

unfactorR Documentation

Remove Factor From Object

Description

Takes an object that is a factor and returns an unfactored vector with the same type by the value removed

Usage

unfactor(fctobj)

Arguments

fctobj

Factorized object

Value

Object with factors removed

Examples


df = data.frame(
   text  = c("a", "b", "c"),
   float = c( 1 ,  2 ,  3 ))

df$float = as.factor(df$float)
# This is a factor
df$float
# This is not a factor
unfactor(df$float)

formods documentation built on April 12, 2025, 1:57 a.m.