powered by
Convert variables to factors
conv.factor(data, convNames = NULL, exceptNames = NULL, uniqueNum = 5)
A data frame of converted variables.
Input data frame.
Names of variable to convert, the default is convNames = NULL.
convNames = NULL
Names of variables to be excluded from conversion, the default is convNames = NULL.
Variables of less than or equal to a specific number of unique values in the to be converted to factors, the default is uniqueNum = 5.
uniqueNum = 5
nhanes.fix <- conv.factor(data = nhanes, convNames = c("age", "hyp"))
Run the code above in your browser using DataLab