Learn R Programming

BBmisc (version 1.13)

convertDataFrameCols: Converts columns in a data frame to characters, factors or numerics.

Description

Converts columns in a data frame to characters, factors or numerics.

Usage

convertDataFrameCols(
  df,
  chars.as.factor = FALSE,
  factors.as.char = FALSE,
  ints.as.num = FALSE,
  logicals.as.factor = FALSE
)

Value

[data.frame].

Arguments

df

[data.frame]
Data frame.

chars.as.factor

[logical(1)]
Should characters be converted to factors? Default is FALSE.

factors.as.char

[logical(1)]
Should characters be converted to factors? Default is FALSE.

ints.as.num

[logical(1)]
Should integers be converted to numerics? Default is FALSE.

logicals.as.factor

[logical(1)]
Should logicals be converted to factors? Default is FALSE.