i_to_base_class: remove class i_labelled and return base R class

View source: R/coerce.R

i_to_base_classR Documentation

remove class i_labelled and return base R class

Description

- when value labels for all values are available will return factor

- when value labels are missing will unclass i_labelled

- remove class i_labelled and return variable as base R class

Usage

i_to_base_class(
  x,
  missing_to_na = TRUE,
  as_factor = TRUE,
  keep_attributes = FALSE
)

Arguments

x

vector or data.frame

missing_to_na

missing values will become regular NA

as_factor

convert to factor when value labels are available

keep_attributes

should attributes be preserved

Value

Returns x coerced to R base class


ilabelled documentation built on April 3, 2025, 10:38 p.m.