Description Usage Arguments Details Value Examples
convertType
will convert specified variables in dataset to other types.
1 | convertType(df, toType, vars = -1)
|
df |
A dataframe to be converted. |
toType |
The type converted to be, values must be one of |
vars |
Vector of column names or numbers to convert, |
when vars=-1
, which variables to be converted depends on toType
:
if toType="fac"
, all the character variables will be converted;
if toType="cha"
, all the factor variables will be converted;
if toType="int"
, all the numeric variables will be converted.
A new dataframe with the same order of variables
1 2 | data(CreditData)
sample_fac <- convertType(CreditData, toType="fac")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.