Converts non-factor/non-numeric variables in a data frame to factor/numeric. Stores information to revert back.

convert(X, check = FALSE)

Arguments

X

A data frame.

check

If TRUE, the function checks if the converted columns can be reverted without changes.

Value

A list with the following elements: X is the converted dataframe, vars, types, classes are the names, types and classes of the converted variables. Finally, bad names variables in X that should have been converted but could not.

Author

Michael Mayer