Learn R Programming

JointAI (version 1.1.0)

convert_variables: Convert variables

Description

Cleans up the data by

  • changing NaN to NA

  • converting continuous variables with just two values to factor

  • converting logical variables to a factor

  • cleaning factor labels (using make.names())

Usage

convert_variables(data, allvars, mess = TRUE)

Value

the cleaned data.frame

Arguments

data

a data.frame

allvars

a character vector of the relevant variables in data

mess

logical, if TRUE messages are printed

Details

used in model_imp (2025-09-07)