nom2dum(infert$"education") # default
nom2dum(infert$"education", prefix = "edu_") # use of the `prefix` argument
nom2dum(nom = infert$"education", yes = "one", no = "zero",
rtn.fct = TRUE) # returns factor columns
Run the code above in your browser using DataLab