powered by
Convert Categorical Data to Dummy Variables
dummy_convert(dataset,column_names)
Data frame that contains the categorical columns
A list of column names that need to be converted to dummy variables.
# NOT RUN { x<-data.frame(trt=as.factor(rbinom(100,1,0.5)), Gender=as.factor(rbinom(100,1,0.5))) dummy_convert(x,c("trt","Gender")) # }
Run the code above in your browser using DataLab