type.convert()
Convert a data object to logical, integer, numeric, complex, character or factor as appropriate.
Add the as.is argument type.convert(df,as.is = T)
to prevent character vectors from becoming factors when there is a non-numeric in the data set.